1 /* Generated by Cython 0.29.20 */
2
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8 #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_29_20"
11 #define CYTHON_HEX_VERSION 0x001D14F0
12 #define CYTHON_FUTURE_DIVISION 0
13 #include <stddef.h>
14 #ifndef offsetof
15 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
16 #endif
17 #if !defined(WIN32) && !defined(MS_WINDOWS)
18 #ifndef __stdcall
19 #define __stdcall
20 #endif
21 #ifndef __cdecl
22 #define __cdecl
23 #endif
24 #ifndef __fastcall
25 #define __fastcall
26 #endif
27 #endif
28 #ifndef DL_IMPORT
29 #define DL_IMPORT(t) t
30 #endif
31 #ifndef DL_EXPORT
32 #define DL_EXPORT(t) t
33 #endif
34 #define __PYX_COMMA ,
35 #ifndef HAVE_LONG_LONG
36 #if PY_VERSION_HEX >= 0x02070000
37 #define HAVE_LONG_LONG
38 #endif
39 #endif
40 #ifndef PY_LONG_LONG
41 #define PY_LONG_LONG LONG_LONG
42 #endif
43 #ifndef Py_HUGE_VAL
44 #define Py_HUGE_VAL HUGE_VAL
45 #endif
46 #ifdef PYPY_VERSION
47 #define CYTHON_COMPILING_IN_PYPY 1
48 #define CYTHON_COMPILING_IN_PYSTON 0
49 #define CYTHON_COMPILING_IN_CPYTHON 0
50 #undef CYTHON_USE_TYPE_SLOTS
51 #define CYTHON_USE_TYPE_SLOTS 0
52 #undef CYTHON_USE_PYTYPE_LOOKUP
53 #define CYTHON_USE_PYTYPE_LOOKUP 0
54 #if PY_VERSION_HEX < 0x03050000
55 #undef CYTHON_USE_ASYNC_SLOTS
56 #define CYTHON_USE_ASYNC_SLOTS 0
57 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
58 #define CYTHON_USE_ASYNC_SLOTS 1
59 #endif
60 #undef CYTHON_USE_PYLIST_INTERNALS
61 #define CYTHON_USE_PYLIST_INTERNALS 0
62 #undef CYTHON_USE_UNICODE_INTERNALS
63 #define CYTHON_USE_UNICODE_INTERNALS 0
64 #undef CYTHON_USE_UNICODE_WRITER
65 #define CYTHON_USE_UNICODE_WRITER 0
66 #undef CYTHON_USE_PYLONG_INTERNALS
67 #define CYTHON_USE_PYLONG_INTERNALS 0
68 #undef CYTHON_AVOID_BORROWED_REFS
69 #define CYTHON_AVOID_BORROWED_REFS 1
70 #undef CYTHON_ASSUME_SAFE_MACROS
71 #define CYTHON_ASSUME_SAFE_MACROS 0
72 #undef CYTHON_UNPACK_METHODS
73 #define CYTHON_UNPACK_METHODS 0
74 #undef CYTHON_FAST_THREAD_STATE
75 #define CYTHON_FAST_THREAD_STATE 0
76 #undef CYTHON_FAST_PYCALL
77 #define CYTHON_FAST_PYCALL 0
78 #undef CYTHON_PEP489_MULTI_PHASE_INIT
79 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
80 #undef CYTHON_USE_TP_FINALIZE
81 #define CYTHON_USE_TP_FINALIZE 0
82 #undef CYTHON_USE_DICT_VERSIONS
83 #define CYTHON_USE_DICT_VERSIONS 0
84 #undef CYTHON_USE_EXC_INFO_STACK
85 #define CYTHON_USE_EXC_INFO_STACK 0
86 #elif defined(PYSTON_VERSION)
87 #define CYTHON_COMPILING_IN_PYPY 0
88 #define CYTHON_COMPILING_IN_PYSTON 1
89 #define CYTHON_COMPILING_IN_CPYTHON 0
90 #ifndef CYTHON_USE_TYPE_SLOTS
91 #define CYTHON_USE_TYPE_SLOTS 1
92 #endif
93 #undef CYTHON_USE_PYTYPE_LOOKUP
94 #define CYTHON_USE_PYTYPE_LOOKUP 0
95 #undef CYTHON_USE_ASYNC_SLOTS
96 #define CYTHON_USE_ASYNC_SLOTS 0
97 #undef CYTHON_USE_PYLIST_INTERNALS
98 #define CYTHON_USE_PYLIST_INTERNALS 0
99 #ifndef CYTHON_USE_UNICODE_INTERNALS
100 #define CYTHON_USE_UNICODE_INTERNALS 1
101 #endif
102 #undef CYTHON_USE_UNICODE_WRITER
103 #define CYTHON_USE_UNICODE_WRITER 0
104 #undef CYTHON_USE_PYLONG_INTERNALS
105 #define CYTHON_USE_PYLONG_INTERNALS 0
106 #ifndef CYTHON_AVOID_BORROWED_REFS
107 #define CYTHON_AVOID_BORROWED_REFS 0
108 #endif
109 #ifndef CYTHON_ASSUME_SAFE_MACROS
110 #define CYTHON_ASSUME_SAFE_MACROS 1
111 #endif
112 #ifndef CYTHON_UNPACK_METHODS
113 #define CYTHON_UNPACK_METHODS 1
114 #endif
115 #undef CYTHON_FAST_THREAD_STATE
116 #define CYTHON_FAST_THREAD_STATE 0
117 #undef CYTHON_FAST_PYCALL
118 #define CYTHON_FAST_PYCALL 0
119 #undef CYTHON_PEP489_MULTI_PHASE_INIT
120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121 #undef CYTHON_USE_TP_FINALIZE
122 #define CYTHON_USE_TP_FINALIZE 0
123 #undef CYTHON_USE_DICT_VERSIONS
124 #define CYTHON_USE_DICT_VERSIONS 0
125 #undef CYTHON_USE_EXC_INFO_STACK
126 #define CYTHON_USE_EXC_INFO_STACK 0
127 #else
128 #define CYTHON_COMPILING_IN_PYPY 0
129 #define CYTHON_COMPILING_IN_PYSTON 0
130 #define CYTHON_COMPILING_IN_CPYTHON 1
131 #ifndef CYTHON_USE_TYPE_SLOTS
132 #define CYTHON_USE_TYPE_SLOTS 1
133 #endif
134 #if PY_VERSION_HEX < 0x02070000
135 #undef CYTHON_USE_PYTYPE_LOOKUP
136 #define CYTHON_USE_PYTYPE_LOOKUP 0
137 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
138 #define CYTHON_USE_PYTYPE_LOOKUP 1
139 #endif
140 #if PY_MAJOR_VERSION < 3
141 #undef CYTHON_USE_ASYNC_SLOTS
142 #define CYTHON_USE_ASYNC_SLOTS 0
143 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
144 #define CYTHON_USE_ASYNC_SLOTS 1
145 #endif
146 #if PY_VERSION_HEX < 0x02070000
147 #undef CYTHON_USE_PYLONG_INTERNALS
148 #define CYTHON_USE_PYLONG_INTERNALS 0
149 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
150 #define CYTHON_USE_PYLONG_INTERNALS 1
151 #endif
152 #ifndef CYTHON_USE_PYLIST_INTERNALS
153 #define CYTHON_USE_PYLIST_INTERNALS 1
154 #endif
155 #ifndef CYTHON_USE_UNICODE_INTERNALS
156 #define CYTHON_USE_UNICODE_INTERNALS 1
157 #endif
158 #if PY_VERSION_HEX < 0x030300F0
159 #undef CYTHON_USE_UNICODE_WRITER
160 #define CYTHON_USE_UNICODE_WRITER 0
161 #elif !defined(CYTHON_USE_UNICODE_WRITER)
162 #define CYTHON_USE_UNICODE_WRITER 1
163 #endif
164 #ifndef CYTHON_AVOID_BORROWED_REFS
165 #define CYTHON_AVOID_BORROWED_REFS 0
166 #endif
167 #ifndef CYTHON_ASSUME_SAFE_MACROS
168 #define CYTHON_ASSUME_SAFE_MACROS 1
169 #endif
170 #ifndef CYTHON_UNPACK_METHODS
171 #define CYTHON_UNPACK_METHODS 1
172 #endif
173 #ifndef CYTHON_FAST_THREAD_STATE
174 #define CYTHON_FAST_THREAD_STATE 1
175 #endif
176 #ifndef CYTHON_FAST_PYCALL
177 #define CYTHON_FAST_PYCALL 1
178 #endif
179 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
180 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
181 #endif
182 #ifndef CYTHON_USE_TP_FINALIZE
183 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
184 #endif
185 #ifndef CYTHON_USE_DICT_VERSIONS
186 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
187 #endif
188 #ifndef CYTHON_USE_EXC_INFO_STACK
189 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
190 #endif
191 #endif
192 #if !defined(CYTHON_FAST_PYCCALL)
193 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
194 #endif
195 #if CYTHON_USE_PYLONG_INTERNALS
196 #include "longintrepr.h"
197 #undef SHIFT
198 #undef BASE
199 #undef MASK
200 #ifdef SIZEOF_VOID_P
201 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
202 #endif
203 #endif
204 #ifndef __has_attribute
205 #define __has_attribute(x) 0
206 #endif
207 #ifndef __has_cpp_attribute
208 #define __has_cpp_attribute(x) 0
209 #endif
210 #ifndef CYTHON_RESTRICT
211 #if defined(__GNUC__)
212 #define CYTHON_RESTRICT __restrict__
213 #elif defined(_MSC_VER) && _MSC_VER >= 1400
214 #define CYTHON_RESTRICT __restrict
215 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
216 #define CYTHON_RESTRICT restrict
217 #else
218 #define CYTHON_RESTRICT
219 #endif
220 #endif
221 #ifndef CYTHON_UNUSED
222 # if defined(__GNUC__)
223 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
224 # define CYTHON_UNUSED __attribute__ ((__unused__))
225 # else
226 # define CYTHON_UNUSED
227 # endif
228 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
229 # define CYTHON_UNUSED __attribute__ ((__unused__))
230 # else
231 # define CYTHON_UNUSED
232 # endif
233 #endif
234 #ifndef CYTHON_MAYBE_UNUSED_VAR
235 # if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)236 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
237 # else
238 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
239 # endif
240 #endif
241 #ifndef CYTHON_NCP_UNUSED
242 # if CYTHON_COMPILING_IN_CPYTHON
243 # define CYTHON_NCP_UNUSED
244 # else
245 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
246 # endif
247 #endif
248 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
249 #ifdef _MSC_VER
250 #ifndef _MSC_STDINT_H_
251 #if _MSC_VER < 1300
252 typedef unsigned char uint8_t;
253 typedef unsigned int uint32_t;
254 #else
255 typedef unsigned __int8 uint8_t;
256 typedef unsigned __int32 uint32_t;
257 #endif
258 #endif
259 #else
260 #include <stdint.h>
261 #endif
262 #ifndef CYTHON_FALLTHROUGH
263 #if defined(__cplusplus) && __cplusplus >= 201103L
264 #if __has_cpp_attribute(fallthrough)
265 #define CYTHON_FALLTHROUGH [[fallthrough]]
266 #elif __has_cpp_attribute(clang::fallthrough)
267 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
268 #elif __has_cpp_attribute(gnu::fallthrough)
269 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
270 #endif
271 #endif
272 #ifndef CYTHON_FALLTHROUGH
273 #if __has_attribute(fallthrough)
274 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
275 #else
276 #define CYTHON_FALLTHROUGH
277 #endif
278 #endif
279 #if defined(__clang__ ) && defined(__apple_build_version__)
280 #if __apple_build_version__ < 7000000
281 #undef CYTHON_FALLTHROUGH
282 #define CYTHON_FALLTHROUGH
283 #endif
284 #endif
285 #endif
286
287 #ifndef CYTHON_INLINE
288 #if defined(__clang__)
289 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
290 #elif defined(__GNUC__)
291 #define CYTHON_INLINE __inline__
292 #elif defined(_MSC_VER)
293 #define CYTHON_INLINE __inline
294 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
295 #define CYTHON_INLINE inline
296 #else
297 #define CYTHON_INLINE
298 #endif
299 #endif
300
301 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
302 #define Py_OptimizeFlag 0
303 #endif
304 #define __PYX_BUILD_PY_SSIZE_T "n"
305 #define CYTHON_FORMAT_SSIZE_T "z"
306 #if PY_MAJOR_VERSION < 3
307 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
308 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
309 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
310 #define __Pyx_DefaultClassType PyClass_Type
311 #else
312 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
313 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
314 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
315 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
316 #else
317 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
318 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
319 #endif
320 #define __Pyx_DefaultClassType PyType_Type
321 #endif
322 #ifndef Py_TPFLAGS_CHECKTYPES
323 #define Py_TPFLAGS_CHECKTYPES 0
324 #endif
325 #ifndef Py_TPFLAGS_HAVE_INDEX
326 #define Py_TPFLAGS_HAVE_INDEX 0
327 #endif
328 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
329 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
330 #endif
331 #ifndef Py_TPFLAGS_HAVE_FINALIZE
332 #define Py_TPFLAGS_HAVE_FINALIZE 0
333 #endif
334 #ifndef METH_STACKLESS
335 #define METH_STACKLESS 0
336 #endif
337 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
338 #ifndef METH_FASTCALL
339 #define METH_FASTCALL 0x80
340 #endif
341 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
342 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
343 Py_ssize_t nargs, PyObject *kwnames);
344 #else
345 #define __Pyx_PyCFunctionFast _PyCFunctionFast
346 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
347 #endif
348 #if CYTHON_FAST_PYCCALL
349 #define __Pyx_PyFastCFunction_Check(func)\
350 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
351 #else
352 #define __Pyx_PyFastCFunction_Check(func) 0
353 #endif
354 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
355 #define PyObject_Malloc(s) PyMem_Malloc(s)
356 #define PyObject_Free(p) PyMem_Free(p)
357 #define PyObject_Realloc(p) PyMem_Realloc(p)
358 #endif
359 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
360 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
361 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
362 #define PyMem_RawFree(p) PyMem_Free(p)
363 #endif
364 #if CYTHON_COMPILING_IN_PYSTON
365 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
366 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
367 #else
368 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
369 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
370 #endif
371 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
372 #define __Pyx_PyThreadState_Current PyThreadState_GET()
373 #elif PY_VERSION_HEX >= 0x03060000
374 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
375 #elif PY_VERSION_HEX >= 0x03000000
376 #define __Pyx_PyThreadState_Current PyThreadState_GET()
377 #else
378 #define __Pyx_PyThreadState_Current _PyThreadState_Current
379 #endif
380 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
381 #include "pythread.h"
382 #define Py_tss_NEEDS_INIT 0
383 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)384 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
385 *key = PyThread_create_key();
386 return 0;
387 }
PyThread_tss_alloc(void)388 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
389 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
390 *key = Py_tss_NEEDS_INIT;
391 return key;
392 }
PyThread_tss_free(Py_tss_t * key)393 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
394 PyObject_Free(key);
395 }
PyThread_tss_is_created(Py_tss_t * key)396 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
397 return *key != Py_tss_NEEDS_INIT;
398 }
PyThread_tss_delete(Py_tss_t * key)399 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
400 PyThread_delete_key(*key);
401 *key = Py_tss_NEEDS_INIT;
402 }
PyThread_tss_set(Py_tss_t * key,void * value)403 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
404 return PyThread_set_key_value(*key, value);
405 }
PyThread_tss_get(Py_tss_t * key)406 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
407 return PyThread_get_key_value(*key);
408 }
409 #endif
410 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
411 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
412 #else
413 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
414 #endif
415 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
416 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
417 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
418 #else
419 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
420 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
421 #endif
422 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
423 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
424 #else
425 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
426 #endif
427 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
428 #define CYTHON_PEP393_ENABLED 1
429 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
430 0 : _PyUnicode_Ready((PyObject *)(op)))
431 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
432 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
433 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
434 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
435 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
436 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
437 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
438 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
439 #else
440 #define CYTHON_PEP393_ENABLED 0
441 #define PyUnicode_1BYTE_KIND 1
442 #define PyUnicode_2BYTE_KIND 2
443 #define PyUnicode_4BYTE_KIND 4
444 #define __Pyx_PyUnicode_READY(op) (0)
445 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
446 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
447 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
448 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
449 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
450 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
451 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
452 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
453 #endif
454 #if CYTHON_COMPILING_IN_PYPY
455 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
456 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
457 #else
458 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
459 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
460 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
461 #endif
462 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
463 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
464 #endif
465 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
466 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
467 #endif
468 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
469 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
470 #endif
471 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
472 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
473 #if PY_MAJOR_VERSION >= 3
474 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
475 #else
476 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
477 #endif
478 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
479 #define PyObject_ASCII(o) PyObject_Repr(o)
480 #endif
481 #if PY_MAJOR_VERSION >= 3
482 #define PyBaseString_Type PyUnicode_Type
483 #define PyStringObject PyUnicodeObject
484 #define PyString_Type PyUnicode_Type
485 #define PyString_Check PyUnicode_Check
486 #define PyString_CheckExact PyUnicode_CheckExact
487 #ifndef PyObject_Unicode
488 #define PyObject_Unicode PyObject_Str
489 #endif
490 #endif
491 #if PY_MAJOR_VERSION >= 3
492 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
493 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
494 #else
495 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
496 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
497 #endif
498 #ifndef PySet_CheckExact
499 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
500 #endif
501 #if PY_VERSION_HEX >= 0x030900A4
502 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
503 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
504 #else
505 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
506 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
507 #endif
508 #if CYTHON_ASSUME_SAFE_MACROS
509 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
510 #else
511 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
512 #endif
513 #if PY_MAJOR_VERSION >= 3
514 #define PyIntObject PyLongObject
515 #define PyInt_Type PyLong_Type
516 #define PyInt_Check(op) PyLong_Check(op)
517 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
518 #define PyInt_FromString PyLong_FromString
519 #define PyInt_FromUnicode PyLong_FromUnicode
520 #define PyInt_FromLong PyLong_FromLong
521 #define PyInt_FromSize_t PyLong_FromSize_t
522 #define PyInt_FromSsize_t PyLong_FromSsize_t
523 #define PyInt_AsLong PyLong_AsLong
524 #define PyInt_AS_LONG PyLong_AS_LONG
525 #define PyInt_AsSsize_t PyLong_AsSsize_t
526 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
527 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
528 #define PyNumber_Int PyNumber_Long
529 #endif
530 #if PY_MAJOR_VERSION >= 3
531 #define PyBoolObject PyLongObject
532 #endif
533 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
534 #ifndef PyUnicode_InternFromString
535 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
536 #endif
537 #endif
538 #if PY_VERSION_HEX < 0x030200A4
539 typedef long Py_hash_t;
540 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
541 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
542 #else
543 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
544 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
545 #endif
546 #if PY_MAJOR_VERSION >= 3
547 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
548 #else
549 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
550 #endif
551 #if CYTHON_USE_ASYNC_SLOTS
552 #if PY_VERSION_HEX >= 0x030500B1
553 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
554 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
555 #else
556 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
557 #endif
558 #else
559 #define __Pyx_PyType_AsAsync(obj) NULL
560 #endif
561 #ifndef __Pyx_PyAsyncMethodsStruct
562 typedef struct {
563 unaryfunc am_await;
564 unaryfunc am_aiter;
565 unaryfunc am_anext;
566 } __Pyx_PyAsyncMethodsStruct;
567 #endif
568
569 #if defined(WIN32) || defined(MS_WINDOWS)
570 #define _USE_MATH_DEFINES
571 #endif
572 #include <math.h>
573 #ifdef NAN
574 #define __PYX_NAN() ((float) NAN)
575 #else
__PYX_NAN()576 static CYTHON_INLINE float __PYX_NAN() {
577 float value;
578 memset(&value, 0xFF, sizeof(value));
579 return value;
580 }
581 #endif
582 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
583 #define __Pyx_truncl trunc
584 #else
585 #define __Pyx_truncl truncl
586 #endif
587
588 #define __PYX_MARK_ERR_POS(f_index, lineno) \
589 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
590 #define __PYX_ERR(f_index, lineno, Ln_error) \
591 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
592
593 #ifndef __PYX_EXTERN_C
594 #ifdef __cplusplus
595 #define __PYX_EXTERN_C extern "C"
596 #else
597 #define __PYX_EXTERN_C extern
598 #endif
599 #endif
600
601 #define __PYX_HAVE__pygame_sdl2__rect
602 #define __PYX_HAVE_API__pygame_sdl2__rect
603 /* Early includes */
604 #include <stdint.h>
605 #include <string.h>
606 #include <stdio.h>
607 #include <stddef.h>
608 #include "SDL.h"
609 #ifdef _OPENMP
610 #include <omp.h>
611 #endif /* _OPENMP */
612
613 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
614 #define CYTHON_WITHOUT_ASSERTIONS
615 #endif
616
617 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
618 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
619
620 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
621 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
622 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
623 #define __PYX_DEFAULT_STRING_ENCODING ""
624 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
625 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
626 #define __Pyx_uchar_cast(c) ((unsigned char)c)
627 #define __Pyx_long_cast(x) ((long)x)
628 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
629 (sizeof(type) < sizeof(Py_ssize_t)) ||\
630 (sizeof(type) > sizeof(Py_ssize_t) &&\
631 likely(v < (type)PY_SSIZE_T_MAX ||\
632 v == (type)PY_SSIZE_T_MAX) &&\
633 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
634 v == (type)PY_SSIZE_T_MIN))) ||\
635 (sizeof(type) == sizeof(Py_ssize_t) &&\
636 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
637 v == (type)PY_SSIZE_T_MAX))) )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)638 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
639 return (size_t) i < (size_t) limit;
640 }
641 #if defined (__cplusplus) && __cplusplus >= 201103L
642 #include <cstdlib>
643 #define __Pyx_sst_abs(value) std::abs(value)
644 #elif SIZEOF_INT >= SIZEOF_SIZE_T
645 #define __Pyx_sst_abs(value) abs(value)
646 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
647 #define __Pyx_sst_abs(value) labs(value)
648 #elif defined (_MSC_VER)
649 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
650 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
651 #define __Pyx_sst_abs(value) llabs(value)
652 #elif defined (__GNUC__)
653 #define __Pyx_sst_abs(value) __builtin_llabs(value)
654 #else
655 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
656 #endif
657 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
658 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
659 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
660 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
661 #define __Pyx_PyBytes_FromString PyBytes_FromString
662 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
663 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
664 #if PY_MAJOR_VERSION < 3
665 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
666 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
667 #else
668 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
669 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
670 #endif
671 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
672 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
673 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
674 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
675 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
676 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
677 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
678 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
679 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
680 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
681 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
682 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
683 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
684 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
685 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
686 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)687 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
688 const Py_UNICODE *u_end = u;
689 while (*u_end++) ;
690 return (size_t)(u_end - u - 1);
691 }
692 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
693 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
694 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
695 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
696 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
697 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
698 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
699 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
700 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
701 #define __Pyx_PySequence_Tuple(obj)\
702 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
703 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
704 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
705 #if CYTHON_ASSUME_SAFE_MACROS
706 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
707 #else
708 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
709 #endif
710 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
711 #if PY_MAJOR_VERSION >= 3
712 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
713 #else
714 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
715 #endif
716 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
717 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
718 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)719 static int __Pyx_init_sys_getdefaultencoding_params(void) {
720 PyObject* sys;
721 PyObject* default_encoding = NULL;
722 PyObject* ascii_chars_u = NULL;
723 PyObject* ascii_chars_b = NULL;
724 const char* default_encoding_c;
725 sys = PyImport_ImportModule("sys");
726 if (!sys) goto bad;
727 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
728 Py_DECREF(sys);
729 if (!default_encoding) goto bad;
730 default_encoding_c = PyBytes_AsString(default_encoding);
731 if (!default_encoding_c) goto bad;
732 if (strcmp(default_encoding_c, "ascii") == 0) {
733 __Pyx_sys_getdefaultencoding_not_ascii = 0;
734 } else {
735 char ascii_chars[128];
736 int c;
737 for (c = 0; c < 128; c++) {
738 ascii_chars[c] = c;
739 }
740 __Pyx_sys_getdefaultencoding_not_ascii = 1;
741 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
742 if (!ascii_chars_u) goto bad;
743 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
744 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
745 PyErr_Format(
746 PyExc_ValueError,
747 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
748 default_encoding_c);
749 goto bad;
750 }
751 Py_DECREF(ascii_chars_u);
752 Py_DECREF(ascii_chars_b);
753 }
754 Py_DECREF(default_encoding);
755 return 0;
756 bad:
757 Py_XDECREF(default_encoding);
758 Py_XDECREF(ascii_chars_u);
759 Py_XDECREF(ascii_chars_b);
760 return -1;
761 }
762 #endif
763 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
764 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
765 #else
766 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
767 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
768 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)769 static int __Pyx_init_sys_getdefaultencoding_params(void) {
770 PyObject* sys;
771 PyObject* default_encoding = NULL;
772 char* default_encoding_c;
773 sys = PyImport_ImportModule("sys");
774 if (!sys) goto bad;
775 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
776 Py_DECREF(sys);
777 if (!default_encoding) goto bad;
778 default_encoding_c = PyBytes_AsString(default_encoding);
779 if (!default_encoding_c) goto bad;
780 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
781 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
782 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
783 Py_DECREF(default_encoding);
784 return 0;
785 bad:
786 Py_XDECREF(default_encoding);
787 return -1;
788 }
789 #endif
790 #endif
791
792
793 /* Test for GCC > 2.95 */
794 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
795 #define likely(x) __builtin_expect(!!(x), 1)
796 #define unlikely(x) __builtin_expect(!!(x), 0)
797 #else /* !__GNUC__ or GCC < 2.95 */
798 #define likely(x) (x)
799 #define unlikely(x) (x)
800 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)801 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
802
803 static PyObject *__pyx_m = NULL;
804 static PyObject *__pyx_d;
805 static PyObject *__pyx_b;
806 static PyObject *__pyx_cython_runtime = NULL;
807 static PyObject *__pyx_empty_tuple;
808 static PyObject *__pyx_empty_bytes;
809 static PyObject *__pyx_empty_unicode;
810 static int __pyx_lineno;
811 static int __pyx_clineno = 0;
812 static const char * __pyx_cfilenm= __FILE__;
813 static const char *__pyx_filename;
814
815
816 static const char *__pyx_f[] = {
817 "src/pygame_sdl2/rect.pyx",
818 "src/pygame_sdl2/rect.pxd",
819 };
820
821 /*--- Type declarations ---*/
822 struct __pyx_obj_11pygame_sdl2_4rect_Rect;
823 struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect;
824
825 /* "pygame_sdl2/rect.pxd":31
826 *
827 *
828 * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=*) except -1 # <<<<<<<<<<<<<<
829 */
830 struct __pyx_opt_args_11pygame_sdl2_4rect_to_sdl_rect {
831 int __pyx_n;
832 PyObject *argname;
833 };
834
835 /* "pygame_sdl2/rect.pxd":21
836 * from sdl2 cimport *
837 *
838 * cdef class Rect: # <<<<<<<<<<<<<<
839 * # Allow weak references.
840 * cdef object __weakref__
841 */
842 struct __pyx_obj_11pygame_sdl2_4rect_Rect {
843 PyObject_HEAD
844 PyObject *__weakref__;
845 int x;
846 int y;
847 int w;
848 int h;
849 };
850
851
852 /* --- Runtime support code (head) --- */
853 /* Refnanny.proto */
854 #ifndef CYTHON_REFNANNY
855 #define CYTHON_REFNANNY 0
856 #endif
857 #if CYTHON_REFNANNY
858 typedef struct {
859 void (*INCREF)(void*, PyObject*, int);
860 void (*DECREF)(void*, PyObject*, int);
861 void (*GOTREF)(void*, PyObject*, int);
862 void (*GIVEREF)(void*, PyObject*, int);
863 void* (*SetupContext)(const char*, int, const char*);
864 void (*FinishContext)(void**);
865 } __Pyx_RefNannyAPIStruct;
866 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
867 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
868 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
869 #ifdef WITH_THREAD
870 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
871 if (acquire_gil) {\
872 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
873 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
874 PyGILState_Release(__pyx_gilstate_save);\
875 } else {\
876 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
877 }
878 #else
879 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
880 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
881 #endif
882 #define __Pyx_RefNannyFinishContext()\
883 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
884 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
885 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
886 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
887 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
888 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
889 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
890 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
891 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
892 #else
893 #define __Pyx_RefNannyDeclarations
894 #define __Pyx_RefNannySetupContext(name, acquire_gil)
895 #define __Pyx_RefNannyFinishContext()
896 #define __Pyx_INCREF(r) Py_INCREF(r)
897 #define __Pyx_DECREF(r) Py_DECREF(r)
898 #define __Pyx_GOTREF(r)
899 #define __Pyx_GIVEREF(r)
900 #define __Pyx_XINCREF(r) Py_XINCREF(r)
901 #define __Pyx_XDECREF(r) Py_XDECREF(r)
902 #define __Pyx_XGOTREF(r)
903 #define __Pyx_XGIVEREF(r)
904 #endif
905 #define __Pyx_XDECREF_SET(r, v) do {\
906 PyObject *tmp = (PyObject *) r;\
907 r = v; __Pyx_XDECREF(tmp);\
908 } while (0)
909 #define __Pyx_DECREF_SET(r, v) do {\
910 PyObject *tmp = (PyObject *) r;\
911 r = v; __Pyx_DECREF(tmp);\
912 } while (0)
913 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
914 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
915
916 /* PyObjectGetAttrStr.proto */
917 #if CYTHON_USE_TYPE_SLOTS
918 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
919 #else
920 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
921 #endif
922
923 /* GetBuiltinName.proto */
924 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
925
926 /* KeywordStringCheck.proto */
927 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
928
929 /* GetItemInt.proto */
930 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
931 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
932 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
933 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
934 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
935 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
936 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
937 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
938 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
939 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
940 int wraparound, int boundscheck);
941 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
942 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
943 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
944 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
945 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
946 int wraparound, int boundscheck);
947 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
948 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
949 int is_list, int wraparound, int boundscheck);
950
951 /* ExtTypeTest.proto */
952 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
953
954 /* RaiseTooManyValuesToUnpack.proto */
955 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
956
957 /* RaiseNeedMoreValuesToUnpack.proto */
958 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
959
960 /* IterFinish.proto */
961 static CYTHON_INLINE int __Pyx_IterFinish(void);
962
963 /* UnpackItemEndCheck.proto */
964 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
965
966 /* PyObjectCall.proto */
967 #if CYTHON_COMPILING_IN_CPYTHON
968 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
969 #else
970 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
971 #endif
972
973 /* PyThreadStateGet.proto */
974 #if CYTHON_FAST_THREAD_STATE
975 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
976 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
977 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
978 #else
979 #define __Pyx_PyThreadState_declare
980 #define __Pyx_PyThreadState_assign
981 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
982 #endif
983
984 /* PyErrFetchRestore.proto */
985 #if CYTHON_FAST_THREAD_STATE
986 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
987 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
988 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
989 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
990 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
991 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
992 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
993 #if CYTHON_COMPILING_IN_CPYTHON
994 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
995 #else
996 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
997 #endif
998 #else
999 #define __Pyx_PyErr_Clear() PyErr_Clear()
1000 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1001 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1002 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1003 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1004 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1005 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1006 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1007 #endif
1008
1009 /* RaiseException.proto */
1010 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1011
1012 /* PyCFunctionFastCall.proto */
1013 #if CYTHON_FAST_PYCCALL
1014 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1015 #else
1016 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1017 #endif
1018
1019 /* PyFunctionFastCall.proto */
1020 #if CYTHON_FAST_PYCALL
1021 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1022 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1023 #if 1 || PY_VERSION_HEX < 0x030600B1
1024 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1025 #else
1026 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1027 #endif
1028 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1029 (sizeof(char [1 - 2*!(cond)]) - 1)
1030 #ifndef Py_MEMBER_SIZE
1031 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1032 #endif
1033 static size_t __pyx_pyframe_localsplus_offset = 0;
1034 #include "frameobject.h"
1035 #define __Pxy_PyFrame_Initialize_Offsets()\
1036 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1037 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1038 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1039 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1040 #endif
1041
1042 /* PyObjectCallMethO.proto */
1043 #if CYTHON_COMPILING_IN_CPYTHON
1044 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1045 #endif
1046
1047 /* PyObjectCallOneArg.proto */
1048 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1049
1050 /* ObjectGetItem.proto */
1051 #if CYTHON_USE_TYPE_SLOTS
1052 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1053 #else
1054 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1055 #endif
1056
1057 /* PyIntCompare.proto */
1058 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1059
1060 /* PyObjectSetAttrStr.proto */
1061 #if CYTHON_USE_TYPE_SLOTS
1062 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1063 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1064 #else
1065 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1066 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1067 #endif
1068
1069 /* None.proto */
1070 static CYTHON_INLINE long __Pyx_div_long(long, long);
1071
1072 /* PyObjectCallNoArg.proto */
1073 #if CYTHON_COMPILING_IN_CPYTHON
1074 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1075 #else
1076 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1077 #endif
1078
1079 /* PyDictVersioning.proto */
1080 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1081 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1082 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1083 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1084 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1085 (cache_var) = (value);
1086 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1087 static PY_UINT64_T __pyx_dict_version = 0;\
1088 static PyObject *__pyx_dict_cached_value = NULL;\
1089 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1090 (VAR) = __pyx_dict_cached_value;\
1091 } else {\
1092 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1093 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1094 }\
1095 }
1096 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1097 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1098 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1099 #else
1100 #define __PYX_GET_DICT_VERSION(dict) (0)
1101 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1102 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1103 #endif
1104
1105 /* GetModuleGlobalName.proto */
1106 #if CYTHON_USE_DICT_VERSIONS
1107 #define __Pyx_GetModuleGlobalName(var, name) {\
1108 static PY_UINT64_T __pyx_dict_version = 0;\
1109 static PyObject *__pyx_dict_cached_value = NULL;\
1110 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1111 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1112 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1113 }
1114 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1115 PY_UINT64_T __pyx_dict_version;\
1116 PyObject *__pyx_dict_cached_value;\
1117 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1118 }
1119 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1120 #else
1121 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1122 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1123 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1124 #endif
1125
1126 /* PyObjectCall2Args.proto */
1127 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1128
1129 /* RaiseDoubleKeywords.proto */
1130 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1131
1132 /* ParseKeywords.proto */
1133 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1134 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1135 const char* function_name);
1136
1137 /* RaiseArgTupleInvalid.proto */
1138 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1139 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1140
1141 /* ListAppend.proto */
1142 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1143 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1144 PyListObject* L = (PyListObject*) list;
1145 Py_ssize_t len = Py_SIZE(list);
1146 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1147 Py_INCREF(x);
1148 PyList_SET_ITEM(list, len, x);
1149 __Pyx_SET_SIZE(list, len + 1);
1150 return 0;
1151 }
1152 return PyList_Append(list, x);
1153 }
1154 #else
1155 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1156 #endif
1157
1158 /* GetTopmostException.proto */
1159 #if CYTHON_USE_EXC_INFO_STACK
1160 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1161 #endif
1162
1163 /* SaveResetException.proto */
1164 #if CYTHON_FAST_THREAD_STATE
1165 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1166 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1167 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1168 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1169 #else
1170 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1171 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1172 #endif
1173
1174 /* PyObject_GenericGetAttrNoDict.proto */
1175 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1176 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1177 #else
1178 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1179 #endif
1180
1181 /* PyObject_GenericGetAttr.proto */
1182 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1183 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1184 #else
1185 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1186 #endif
1187
1188 /* Import.proto */
1189 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1190
1191 /* CLineInTraceback.proto */
1192 #ifdef CYTHON_CLINE_IN_TRACEBACK
1193 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1194 #else
1195 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1196 #endif
1197
1198 /* CodeObjectCache.proto */
1199 typedef struct {
1200 PyCodeObject* code_object;
1201 int code_line;
1202 } __Pyx_CodeObjectCacheEntry;
1203 struct __Pyx_CodeObjectCache {
1204 int count;
1205 int max_count;
1206 __Pyx_CodeObjectCacheEntry* entries;
1207 };
1208 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1209 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1210 static PyCodeObject *__pyx_find_code_object(int code_line);
1211 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1212
1213 /* AddTraceback.proto */
1214 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1215 int py_line, const char *filename);
1216
1217 /* CIntToPy.proto */
1218 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1219
1220 /* CIntToPy.proto */
1221 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1222
1223 /* CIntFromPy.proto */
1224 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1225
1226 /* CIntFromPy.proto */
1227 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1228
1229 /* FastTypeChecks.proto */
1230 #if CYTHON_COMPILING_IN_CPYTHON
1231 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1232 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1233 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1234 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1235 #else
1236 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1237 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1238 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1239 #endif
1240 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1241
1242 /* CheckBinaryVersion.proto */
1243 static int __Pyx_check_binary_version(void);
1244
1245 /* FunctionExport.proto */
1246 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
1247
1248 /* InitStrings.proto */
1249 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1250
1251
1252 /* Module declarations from 'libc.stdint' */
1253
1254 /* Module declarations from 'libc.string' */
1255
1256 /* Module declarations from 'libc.stdio' */
1257
1258 /* Module declarations from 'libc.stddef' */
1259
1260 /* Module declarations from 'sdl2' */
1261
1262 /* Module declarations from 'pygame_sdl2.rect' */
1263 static PyTypeObject *__pyx_ptype_11pygame_sdl2_4rect_Rect = 0;
1264 #define __Pyx_MODULE_NAME "pygame_sdl2.rect"
1265 extern int __pyx_module_is_main_pygame_sdl2__rect;
1266 int __pyx_module_is_main_pygame_sdl2__rect = 0;
1267
1268 /* Implementation of 'pygame_sdl2.rect' */
1269 static PyObject *__pyx_builtin_TypeError;
1270 static PyObject *__pyx_builtin_IndexError;
1271 static PyObject *__pyx_builtin_zip;
1272 static PyObject *__pyx_builtin_range;
1273 static const char __pyx_k_h[] = "h";
1274 static const char __pyx_k_w[] = "w";
1275 static const char __pyx_k_x[] = "x";
1276 static const char __pyx_k_y[] = "y";
1277 static const char __pyx_k_top[] = "top";
1278 static const char __pyx_k_zip[] = "zip";
1279 static const char __pyx_k_Rect[] = "Rect";
1280 static const char __pyx_k_args[] = "args";
1281 static const char __pyx_k_copy[] = "copy";
1282 static const char __pyx_k_left[] = "left";
1283 static const char __pyx_k_main[] = "__main__";
1284 static const char __pyx_k_name[] = "__name__";
1285 static const char __pyx_k_test[] = "__test__";
1286 static const char __pyx_k_items[] = "items";
1287 static const char __pyx_k_other[] = "other";
1288 static const char __pyx_k_range[] = "range";
1289 static const char __pyx_k_right[] = "right";
1290 static const char __pyx_k_width[] = "width";
1291 static const char __pyx_k_bottom[] = "bottom";
1292 static const char __pyx_k_center[] = "center";
1293 static const char __pyx_k_format[] = "format";
1294 static const char __pyx_k_height[] = "height";
1295 static const char __pyx_k_import[] = "__import__";
1296 static const char __pyx_k_centerx[] = "centerx";
1297 static const char __pyx_k_centery[] = "centery";
1298 static const char __pyx_k_flatten[] = "flatten";
1299 static const char __pyx_k_move_ip[] = "move_ip";
1300 static const char __pyx_k_topleft[] = "topleft";
1301 static const char __pyx_k_clamp_ip[] = "clamp_ip";
1302 static const char __pyx_k_union_ip[] = "union_ip";
1303 static const char __pyx_k_TypeError[] = "TypeError";
1304 static const char __pyx_k_IndexError[] = "IndexError";
1305 static const char __pyx_k_inflate_ip[] = "inflate_ip";
1306 static const char __pyx_k_other_dict[] = "other_dict";
1307 static const char __pyx_k_collections[] = "collections";
1308 static const char __pyx_k_colliderect[] = "colliderect";
1309 static const char __pyx_k_unionall_ip[] = "unionall_ip";
1310 static const char __pyx_k_rect_d_d_d_d[] = "<rect(%d, %d, %d, %d)>";
1311 static const char __pyx_k_rects_values[] = "rects_values";
1312 static const char __pyx_k_pygame_sdl2_rect[] = "pygame_sdl2.rect";
1313 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1314 static const char __pyx_k_src_pygame_sdl2_rect_pyx[] = "src/pygame_sdl2/rect.pyx";
1315 static const char __pyx_k_Argument_must_be_a_rect_style_ob[] = "Argument must be a rect style object.";
1316 static const char __pyx_k_Argument_must_be_a_rect_style_ob_2[] = "Argument {} must be a rect style object.";
1317 static PyObject *__pyx_kp_s_Argument_must_be_a_rect_style_ob;
1318 static PyObject *__pyx_kp_s_Argument_must_be_a_rect_style_ob_2;
1319 static PyObject *__pyx_n_s_IndexError;
1320 static PyObject *__pyx_n_s_Rect;
1321 static PyObject *__pyx_n_s_TypeError;
1322 static PyObject *__pyx_n_s_args;
1323 static PyObject *__pyx_n_s_bottom;
1324 static PyObject *__pyx_n_s_center;
1325 static PyObject *__pyx_n_s_centerx;
1326 static PyObject *__pyx_n_s_centery;
1327 static PyObject *__pyx_n_s_clamp_ip;
1328 static PyObject *__pyx_n_s_cline_in_traceback;
1329 static PyObject *__pyx_n_s_collections;
1330 static PyObject *__pyx_n_s_colliderect;
1331 static PyObject *__pyx_n_s_copy;
1332 static PyObject *__pyx_n_s_flatten;
1333 static PyObject *__pyx_n_s_format;
1334 static PyObject *__pyx_n_s_h;
1335 static PyObject *__pyx_n_s_height;
1336 static PyObject *__pyx_n_s_import;
1337 static PyObject *__pyx_n_s_inflate_ip;
1338 static PyObject *__pyx_n_s_items;
1339 static PyObject *__pyx_n_s_left;
1340 static PyObject *__pyx_n_s_main;
1341 static PyObject *__pyx_n_s_move_ip;
1342 static PyObject *__pyx_n_s_name;
1343 static PyObject *__pyx_n_s_other;
1344 static PyObject *__pyx_n_s_other_dict;
1345 static PyObject *__pyx_n_s_pygame_sdl2_rect;
1346 static PyObject *__pyx_n_s_range;
1347 static PyObject *__pyx_kp_s_rect_d_d_d_d;
1348 static PyObject *__pyx_n_s_rects_values;
1349 static PyObject *__pyx_n_s_right;
1350 static PyObject *__pyx_kp_s_src_pygame_sdl2_rect_pyx;
1351 static PyObject *__pyx_n_s_test;
1352 static PyObject *__pyx_n_s_top;
1353 static PyObject *__pyx_n_s_topleft;
1354 static PyObject *__pyx_n_s_union_ip;
1355 static PyObject *__pyx_n_s_unionall_ip;
1356 static PyObject *__pyx_n_s_w;
1357 static PyObject *__pyx_n_s_width;
1358 static PyObject *__pyx_n_s_x;
1359 static PyObject *__pyx_n_s_y;
1360 static PyObject *__pyx_n_s_zip;
1361 static PyObject *__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */
1362 static int __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
1363 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1364 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1365 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 */
1366 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1367 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 */
1368 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 */
1369 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 */
1370 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1371 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 */
1372 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1373 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 */
1374 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1375 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 */
1376 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1377 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 */
1378 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1379 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 */
1380 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1381 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 */
1382 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1383 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 */
1384 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1385 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 */
1386 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1387 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 */
1388 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1389 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 */
1390 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1391 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 */
1392 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1393 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 */
1394 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1395 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 */
1396 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1397 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 */
1398 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1399 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 */
1400 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1401 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 */
1402 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1403 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 */
1404 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1405 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 */
1406 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1407 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
1408 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 */
1409 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
1410 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 */
1411 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
1412 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 */
1413 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 */
1414 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
1415 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 */
1416 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 */
1417 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 */
1418 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
1419 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1420 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
1421 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 */
1422 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
1423 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 */
1424 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 */
1425 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 */
1426 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 */
1427 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1428 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 */
1429 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1430 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 */
1431 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1432 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 */
1433 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self); /* proto */
1434 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 */
1435 static PyObject *__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1436 static PyObject *__pyx_int_0;
1437 static PyObject *__pyx_int_1;
1438 static PyObject *__pyx_int_2;
1439 static PyObject *__pyx_int_3;
1440 static PyObject *__pyx_int_neg_1;
1441 static PyObject *__pyx_tuple_;
1442 static PyObject *__pyx_tuple__2;
1443 static PyObject *__pyx_tuple__3;
1444 static PyObject *__pyx_codeobj__4;
1445 /* Late includes */
1446
1447 /* "pygame_sdl2/rect.pyx":22
1448 * import collections
1449 *
1450 * def flatten(*args): # <<<<<<<<<<<<<<
1451 * if len(args) == 1:
1452 * return args[0]
1453 */
1454
1455 /* Python wrapper */
1456 static PyObject *__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1457 static PyMethodDef __pyx_mdef_11pygame_sdl2_4rect_1flatten = {"flatten", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_1flatten, METH_VARARGS|METH_KEYWORDS, 0};
__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1458 static PyObject *__pyx_pw_11pygame_sdl2_4rect_1flatten(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1459 PyObject *__pyx_v_args = 0;
1460 PyObject *__pyx_r = 0;
1461 __Pyx_RefNannyDeclarations
1462 __Pyx_RefNannySetupContext("flatten (wrapper)", 0);
1463 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "flatten", 0))) return NULL;
1464 __Pyx_INCREF(__pyx_args);
1465 __pyx_v_args = __pyx_args;
1466 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_flatten(__pyx_self, __pyx_v_args);
1467
1468 /* function exit code */
1469 __Pyx_XDECREF(__pyx_v_args);
1470 __Pyx_RefNannyFinishContext();
1471 return __pyx_r;
1472 }
1473
__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject * __pyx_self,PyObject * __pyx_v_args)1474 static PyObject *__pyx_pf_11pygame_sdl2_4rect_flatten(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_args) {
1475 PyObject *__pyx_r = NULL;
1476 __Pyx_RefNannyDeclarations
1477 Py_ssize_t __pyx_t_1;
1478 int __pyx_t_2;
1479 PyObject *__pyx_t_3 = NULL;
1480 int __pyx_lineno = 0;
1481 const char *__pyx_filename = NULL;
1482 int __pyx_clineno = 0;
1483 __Pyx_RefNannySetupContext("flatten", 0);
1484
1485 /* "pygame_sdl2/rect.pyx":23
1486 *
1487 * def flatten(*args):
1488 * if len(args) == 1: # <<<<<<<<<<<<<<
1489 * return args[0]
1490 * else:
1491 */
1492 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 23, __pyx_L1_error)
1493 __pyx_t_2 = ((__pyx_t_1 == 1) != 0);
1494 if (__pyx_t_2) {
1495
1496 /* "pygame_sdl2/rect.pyx":24
1497 * def flatten(*args):
1498 * if len(args) == 1:
1499 * return args[0] # <<<<<<<<<<<<<<
1500 * else:
1501 * return args
1502 */
1503 __Pyx_XDECREF(__pyx_r);
1504 __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, 24, __pyx_L1_error)
1505 __Pyx_GOTREF(__pyx_t_3);
1506 __pyx_r = __pyx_t_3;
1507 __pyx_t_3 = 0;
1508 goto __pyx_L0;
1509
1510 /* "pygame_sdl2/rect.pyx":23
1511 *
1512 * def flatten(*args):
1513 * if len(args) == 1: # <<<<<<<<<<<<<<
1514 * return args[0]
1515 * else:
1516 */
1517 }
1518
1519 /* "pygame_sdl2/rect.pyx":26
1520 * return args[0]
1521 * else:
1522 * return args # <<<<<<<<<<<<<<
1523 *
1524 * cdef class Rect:
1525 */
1526 /*else*/ {
1527 __Pyx_XDECREF(__pyx_r);
1528 __Pyx_INCREF(__pyx_v_args);
1529 __pyx_r = __pyx_v_args;
1530 goto __pyx_L0;
1531 }
1532
1533 /* "pygame_sdl2/rect.pyx":22
1534 * import collections
1535 *
1536 * def flatten(*args): # <<<<<<<<<<<<<<
1537 * if len(args) == 1:
1538 * return args[0]
1539 */
1540
1541 /* function exit code */
1542 __pyx_L1_error:;
1543 __Pyx_XDECREF(__pyx_t_3);
1544 __Pyx_AddTraceback("pygame_sdl2.rect.flatten", __pyx_clineno, __pyx_lineno, __pyx_filename);
1545 __pyx_r = NULL;
1546 __pyx_L0:;
1547 __Pyx_XGIVEREF(__pyx_r);
1548 __Pyx_RefNannyFinishContext();
1549 return __pyx_r;
1550 }
1551
1552 /* "pygame_sdl2/rect.pyx":30
1553 * cdef class Rect:
1554 *
1555 * def __init__(self, *args): # <<<<<<<<<<<<<<
1556 *
1557 * cdef int x, y, w, h
1558 */
1559
1560 /* Python wrapper */
1561 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1562 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1563 PyObject *__pyx_v_args = 0;
1564 int __pyx_r;
1565 __Pyx_RefNannyDeclarations
1566 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
1567 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
1568 __Pyx_INCREF(__pyx_args);
1569 __pyx_v_args = __pyx_args;
1570 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args);
1571
1572 /* function exit code */
1573 __Pyx_XDECREF(__pyx_v_args);
1574 __Pyx_RefNannyFinishContext();
1575 return __pyx_r;
1576 }
1577
__pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_args)1578 static int __pyx_pf_11pygame_sdl2_4rect_4Rect___init__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) {
1579 int __pyx_v_x;
1580 int __pyx_v_y;
1581 int __pyx_v_w;
1582 int __pyx_v_h;
1583 int __pyx_v_len_args;
1584 struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_rect = 0;
1585 int __pyx_r;
1586 __Pyx_RefNannyDeclarations
1587 Py_ssize_t __pyx_t_1;
1588 int __pyx_t_2;
1589 int __pyx_t_3;
1590 PyObject *__pyx_t_4 = NULL;
1591 int __pyx_t_5;
1592 int __pyx_t_6;
1593 PyObject *__pyx_t_7 = NULL;
1594 PyObject *__pyx_t_8 = NULL;
1595 PyObject *__pyx_t_9 = NULL;
1596 PyObject *__pyx_t_10 = NULL;
1597 PyObject *__pyx_t_11 = NULL;
1598 PyObject *(*__pyx_t_12)(PyObject *);
1599 int __pyx_t_13;
1600 int __pyx_t_14;
1601 int __pyx_t_15;
1602 int __pyx_lineno = 0;
1603 const char *__pyx_filename = NULL;
1604 int __pyx_clineno = 0;
1605 __Pyx_RefNannySetupContext("__init__", 0);
1606
1607 /* "pygame_sdl2/rect.pyx":36
1608 * cdef Rect rect
1609 *
1610 * len_args = len(args) # <<<<<<<<<<<<<<
1611 *
1612 * if len_args == 1 and isinstance(args[0], Rect):
1613 */
1614 __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_args); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 36, __pyx_L1_error)
1615 __pyx_v_len_args = __pyx_t_1;
1616
1617 /* "pygame_sdl2/rect.pyx":38
1618 * len_args = len(args)
1619 *
1620 * if len_args == 1 and isinstance(args[0], Rect): # <<<<<<<<<<<<<<
1621 * rect = args[0]
1622 * x = rect.x
1623 */
1624 __pyx_t_3 = ((__pyx_v_len_args == 1) != 0);
1625 if (__pyx_t_3) {
1626 } else {
1627 __pyx_t_2 = __pyx_t_3;
1628 goto __pyx_L4_bool_binop_done;
1629 }
1630 __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 38, __pyx_L1_error)
1631 __Pyx_GOTREF(__pyx_t_4);
1632 __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_4, __pyx_ptype_11pygame_sdl2_4rect_Rect);
1633 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1634 __pyx_t_5 = (__pyx_t_3 != 0);
1635 __pyx_t_2 = __pyx_t_5;
1636 __pyx_L4_bool_binop_done:;
1637 if (__pyx_t_2) {
1638
1639 /* "pygame_sdl2/rect.pyx":39
1640 *
1641 * if len_args == 1 and isinstance(args[0], Rect):
1642 * rect = args[0] # <<<<<<<<<<<<<<
1643 * x = rect.x
1644 * y = rect.y
1645 */
1646 __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
1647 __Pyx_GOTREF(__pyx_t_4);
1648 if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_11pygame_sdl2_4rect_Rect))))) __PYX_ERR(0, 39, __pyx_L1_error)
1649 __pyx_v_rect = ((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_t_4);
1650 __pyx_t_4 = 0;
1651
1652 /* "pygame_sdl2/rect.pyx":40
1653 * if len_args == 1 and isinstance(args[0], Rect):
1654 * rect = args[0]
1655 * x = rect.x # <<<<<<<<<<<<<<
1656 * y = rect.y
1657 * w = rect.w
1658 */
1659 __pyx_t_6 = __pyx_v_rect->x;
1660 __pyx_v_x = __pyx_t_6;
1661
1662 /* "pygame_sdl2/rect.pyx":41
1663 * rect = args[0]
1664 * x = rect.x
1665 * y = rect.y # <<<<<<<<<<<<<<
1666 * w = rect.w
1667 * h = rect.h
1668 */
1669 __pyx_t_6 = __pyx_v_rect->y;
1670 __pyx_v_y = __pyx_t_6;
1671
1672 /* "pygame_sdl2/rect.pyx":42
1673 * x = rect.x
1674 * y = rect.y
1675 * w = rect.w # <<<<<<<<<<<<<<
1676 * h = rect.h
1677 *
1678 */
1679 __pyx_t_6 = __pyx_v_rect->w;
1680 __pyx_v_w = __pyx_t_6;
1681
1682 /* "pygame_sdl2/rect.pyx":43
1683 * y = rect.y
1684 * w = rect.w
1685 * h = rect.h # <<<<<<<<<<<<<<
1686 *
1687 * elif len_args == 1 and len(args[0]) == 4:
1688 */
1689 __pyx_t_6 = __pyx_v_rect->h;
1690 __pyx_v_h = __pyx_t_6;
1691
1692 /* "pygame_sdl2/rect.pyx":38
1693 * len_args = len(args)
1694 *
1695 * if len_args == 1 and isinstance(args[0], Rect): # <<<<<<<<<<<<<<
1696 * rect = args[0]
1697 * x = rect.x
1698 */
1699 goto __pyx_L3;
1700 }
1701
1702 /* "pygame_sdl2/rect.pyx":45
1703 * h = rect.h
1704 *
1705 * elif len_args == 1 and len(args[0]) == 4: # <<<<<<<<<<<<<<
1706 * x, y, w, h = args[0]
1707 *
1708 */
1709 __pyx_t_5 = ((__pyx_v_len_args == 1) != 0);
1710 if (__pyx_t_5) {
1711 } else {
1712 __pyx_t_2 = __pyx_t_5;
1713 goto __pyx_L6_bool_binop_done;
1714 }
1715 __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
1716 __Pyx_GOTREF(__pyx_t_4);
1717 __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 45, __pyx_L1_error)
1718 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1719 __pyx_t_5 = ((__pyx_t_1 == 4) != 0);
1720 __pyx_t_2 = __pyx_t_5;
1721 __pyx_L6_bool_binop_done:;
1722 if (__pyx_t_2) {
1723
1724 /* "pygame_sdl2/rect.pyx":46
1725 *
1726 * elif len_args == 1 and len(args[0]) == 4:
1727 * x, y, w, h = args[0] # <<<<<<<<<<<<<<
1728 *
1729 * elif len_args == 1 and len(args[0]) == 2:
1730 */
1731 __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 46, __pyx_L1_error)
1732 __Pyx_GOTREF(__pyx_t_4);
1733 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
1734 PyObject* sequence = __pyx_t_4;
1735 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1736 if (unlikely(size != 4)) {
1737 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
1738 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1739 __PYX_ERR(0, 46, __pyx_L1_error)
1740 }
1741 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
1742 if (likely(PyTuple_CheckExact(sequence))) {
1743 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0);
1744 __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
1745 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 2);
1746 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 3);
1747 } else {
1748 __pyx_t_7 = PyList_GET_ITEM(sequence, 0);
1749 __pyx_t_8 = PyList_GET_ITEM(sequence, 1);
1750 __pyx_t_9 = PyList_GET_ITEM(sequence, 2);
1751 __pyx_t_10 = PyList_GET_ITEM(sequence, 3);
1752 }
1753 __Pyx_INCREF(__pyx_t_7);
1754 __Pyx_INCREF(__pyx_t_8);
1755 __Pyx_INCREF(__pyx_t_9);
1756 __Pyx_INCREF(__pyx_t_10);
1757 #else
1758 {
1759 Py_ssize_t i;
1760 PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
1761 for (i=0; i < 4; i++) {
1762 PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 46, __pyx_L1_error)
1763 __Pyx_GOTREF(item);
1764 *(temps[i]) = item;
1765 }
1766 }
1767 #endif
1768 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1769 } else {
1770 Py_ssize_t index = -1;
1771 PyObject** temps[4] = {&__pyx_t_7,&__pyx_t_8,&__pyx_t_9,&__pyx_t_10};
1772 __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 46, __pyx_L1_error)
1773 __Pyx_GOTREF(__pyx_t_11);
1774 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1775 __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
1776 for (index=0; index < 4; index++) {
1777 PyObject* item = __pyx_t_12(__pyx_t_11); if (unlikely(!item)) goto __pyx_L8_unpacking_failed;
1778 __Pyx_GOTREF(item);
1779 *(temps[index]) = item;
1780 }
1781 if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 4) < 0) __PYX_ERR(0, 46, __pyx_L1_error)
1782 __pyx_t_12 = NULL;
1783 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1784 goto __pyx_L9_unpacking_done;
1785 __pyx_L8_unpacking_failed:;
1786 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
1787 __pyx_t_12 = NULL;
1788 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
1789 __PYX_ERR(0, 46, __pyx_L1_error)
1790 __pyx_L9_unpacking_done:;
1791 }
1792 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
1793 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
1794 __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
1795 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1796 __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
1797 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
1798 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
1799 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
1800 __pyx_v_x = __pyx_t_6;
1801 __pyx_v_y = __pyx_t_13;
1802 __pyx_v_w = __pyx_t_14;
1803 __pyx_v_h = __pyx_t_15;
1804
1805 /* "pygame_sdl2/rect.pyx":45
1806 * h = rect.h
1807 *
1808 * elif len_args == 1 and len(args[0]) == 4: # <<<<<<<<<<<<<<
1809 * x, y, w, h = args[0]
1810 *
1811 */
1812 goto __pyx_L3;
1813 }
1814
1815 /* "pygame_sdl2/rect.pyx":48
1816 * x, y, w, h = args[0]
1817 *
1818 * elif len_args == 1 and len(args[0]) == 2: # <<<<<<<<<<<<<<
1819 * x, y = args[0]
1820 * w = 0
1821 */
1822 __pyx_t_5 = ((__pyx_v_len_args == 1) != 0);
1823 if (__pyx_t_5) {
1824 } else {
1825 __pyx_t_2 = __pyx_t_5;
1826 goto __pyx_L10_bool_binop_done;
1827 }
1828 __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 48, __pyx_L1_error)
1829 __Pyx_GOTREF(__pyx_t_4);
1830 __pyx_t_1 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 48, __pyx_L1_error)
1831 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1832 __pyx_t_5 = ((__pyx_t_1 == 2) != 0);
1833 __pyx_t_2 = __pyx_t_5;
1834 __pyx_L10_bool_binop_done:;
1835 if (__pyx_t_2) {
1836
1837 /* "pygame_sdl2/rect.pyx":49
1838 *
1839 * elif len_args == 1 and len(args[0]) == 2:
1840 * x, y = args[0] # <<<<<<<<<<<<<<
1841 * w = 0
1842 * h = 0
1843 */
1844 __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 49, __pyx_L1_error)
1845 __Pyx_GOTREF(__pyx_t_4);
1846 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
1847 PyObject* sequence = __pyx_t_4;
1848 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1849 if (unlikely(size != 2)) {
1850 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
1851 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1852 __PYX_ERR(0, 49, __pyx_L1_error)
1853 }
1854 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
1855 if (likely(PyTuple_CheckExact(sequence))) {
1856 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
1857 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
1858 } else {
1859 __pyx_t_10 = PyList_GET_ITEM(sequence, 0);
1860 __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
1861 }
1862 __Pyx_INCREF(__pyx_t_10);
1863 __Pyx_INCREF(__pyx_t_9);
1864 #else
1865 __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 49, __pyx_L1_error)
1866 __Pyx_GOTREF(__pyx_t_10);
1867 __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 49, __pyx_L1_error)
1868 __Pyx_GOTREF(__pyx_t_9);
1869 #endif
1870 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1871 } else {
1872 Py_ssize_t index = -1;
1873 __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 49, __pyx_L1_error)
1874 __Pyx_GOTREF(__pyx_t_8);
1875 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1876 __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext;
1877 index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed;
1878 __Pyx_GOTREF(__pyx_t_10);
1879 index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L12_unpacking_failed;
1880 __Pyx_GOTREF(__pyx_t_9);
1881 if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
1882 __pyx_t_12 = NULL;
1883 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1884 goto __pyx_L13_unpacking_done;
1885 __pyx_L12_unpacking_failed:;
1886 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1887 __pyx_t_12 = NULL;
1888 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
1889 __PYX_ERR(0, 49, __pyx_L1_error)
1890 __pyx_L13_unpacking_done:;
1891 }
1892 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error)
1893 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
1894 __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error)
1895 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
1896 __pyx_v_x = __pyx_t_15;
1897 __pyx_v_y = __pyx_t_14;
1898
1899 /* "pygame_sdl2/rect.pyx":50
1900 * elif len_args == 1 and len(args[0]) == 2:
1901 * x, y = args[0]
1902 * w = 0 # <<<<<<<<<<<<<<
1903 * h = 0
1904 *
1905 */
1906 __pyx_v_w = 0;
1907
1908 /* "pygame_sdl2/rect.pyx":51
1909 * x, y = args[0]
1910 * w = 0
1911 * h = 0 # <<<<<<<<<<<<<<
1912 *
1913 * elif len_args == 2:
1914 */
1915 __pyx_v_h = 0;
1916
1917 /* "pygame_sdl2/rect.pyx":48
1918 * x, y, w, h = args[0]
1919 *
1920 * elif len_args == 1 and len(args[0]) == 2: # <<<<<<<<<<<<<<
1921 * x, y = args[0]
1922 * w = 0
1923 */
1924 goto __pyx_L3;
1925 }
1926
1927 /* "pygame_sdl2/rect.pyx":53
1928 * h = 0
1929 *
1930 * elif len_args == 2: # <<<<<<<<<<<<<<
1931 * x, y = args[0]
1932 * w, h = args[1]
1933 */
1934 __pyx_t_2 = ((__pyx_v_len_args == 2) != 0);
1935 if (__pyx_t_2) {
1936
1937 /* "pygame_sdl2/rect.pyx":54
1938 *
1939 * elif len_args == 2:
1940 * x, y = args[0] # <<<<<<<<<<<<<<
1941 * w, h = args[1]
1942 *
1943 */
1944 __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error)
1945 __Pyx_GOTREF(__pyx_t_4);
1946 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
1947 PyObject* sequence = __pyx_t_4;
1948 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
1949 if (unlikely(size != 2)) {
1950 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
1951 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
1952 __PYX_ERR(0, 54, __pyx_L1_error)
1953 }
1954 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
1955 if (likely(PyTuple_CheckExact(sequence))) {
1956 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
1957 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
1958 } else {
1959 __pyx_t_9 = PyList_GET_ITEM(sequence, 0);
1960 __pyx_t_10 = PyList_GET_ITEM(sequence, 1);
1961 }
1962 __Pyx_INCREF(__pyx_t_9);
1963 __Pyx_INCREF(__pyx_t_10);
1964 #else
1965 __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 54, __pyx_L1_error)
1966 __Pyx_GOTREF(__pyx_t_9);
1967 __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 54, __pyx_L1_error)
1968 __Pyx_GOTREF(__pyx_t_10);
1969 #endif
1970 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1971 } else {
1972 Py_ssize_t index = -1;
1973 __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 54, __pyx_L1_error)
1974 __Pyx_GOTREF(__pyx_t_8);
1975 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1976 __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext;
1977 index = 0; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L14_unpacking_failed;
1978 __Pyx_GOTREF(__pyx_t_9);
1979 index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed;
1980 __Pyx_GOTREF(__pyx_t_10);
1981 if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) __PYX_ERR(0, 54, __pyx_L1_error)
1982 __pyx_t_12 = NULL;
1983 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1984 goto __pyx_L15_unpacking_done;
1985 __pyx_L14_unpacking_failed:;
1986 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
1987 __pyx_t_12 = NULL;
1988 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
1989 __PYX_ERR(0, 54, __pyx_L1_error)
1990 __pyx_L15_unpacking_done:;
1991 }
1992 __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
1993 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
1994 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
1995 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
1996 __pyx_v_x = __pyx_t_14;
1997 __pyx_v_y = __pyx_t_15;
1998
1999 /* "pygame_sdl2/rect.pyx":55
2000 * elif len_args == 2:
2001 * x, y = args[0]
2002 * w, h = args[1] # <<<<<<<<<<<<<<
2003 *
2004 * elif len_args == 4:
2005 */
2006 __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_args, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
2007 __Pyx_GOTREF(__pyx_t_4);
2008 if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
2009 PyObject* sequence = __pyx_t_4;
2010 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
2011 if (unlikely(size != 2)) {
2012 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
2013 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
2014 __PYX_ERR(0, 55, __pyx_L1_error)
2015 }
2016 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2017 if (likely(PyTuple_CheckExact(sequence))) {
2018 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
2019 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
2020 } else {
2021 __pyx_t_10 = PyList_GET_ITEM(sequence, 0);
2022 __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
2023 }
2024 __Pyx_INCREF(__pyx_t_10);
2025 __Pyx_INCREF(__pyx_t_9);
2026 #else
2027 __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 55, __pyx_L1_error)
2028 __Pyx_GOTREF(__pyx_t_10);
2029 __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 55, __pyx_L1_error)
2030 __Pyx_GOTREF(__pyx_t_9);
2031 #endif
2032 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2033 } else {
2034 Py_ssize_t index = -1;
2035 __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 55, __pyx_L1_error)
2036 __Pyx_GOTREF(__pyx_t_8);
2037 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2038 __pyx_t_12 = Py_TYPE(__pyx_t_8)->tp_iternext;
2039 index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_10)) goto __pyx_L16_unpacking_failed;
2040 __Pyx_GOTREF(__pyx_t_10);
2041 index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed;
2042 __Pyx_GOTREF(__pyx_t_9);
2043 if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_8), 2) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
2044 __pyx_t_12 = NULL;
2045 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2046 goto __pyx_L17_unpacking_done;
2047 __pyx_L16_unpacking_failed:;
2048 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2049 __pyx_t_12 = NULL;
2050 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
2051 __PYX_ERR(0, 55, __pyx_L1_error)
2052 __pyx_L17_unpacking_done:;
2053 }
2054 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error)
2055 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
2056 __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error)
2057 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2058 __pyx_v_w = __pyx_t_15;
2059 __pyx_v_h = __pyx_t_14;
2060
2061 /* "pygame_sdl2/rect.pyx":53
2062 * h = 0
2063 *
2064 * elif len_args == 2: # <<<<<<<<<<<<<<
2065 * x, y = args[0]
2066 * w, h = args[1]
2067 */
2068 goto __pyx_L3;
2069 }
2070
2071 /* "pygame_sdl2/rect.pyx":57
2072 * w, h = args[1]
2073 *
2074 * elif len_args == 4: # <<<<<<<<<<<<<<
2075 * x, y, w, h = args
2076 *
2077 */
2078 __pyx_t_2 = ((__pyx_v_len_args == 4) != 0);
2079 if (likely(__pyx_t_2)) {
2080
2081 /* "pygame_sdl2/rect.pyx":58
2082 *
2083 * elif len_args == 4:
2084 * x, y, w, h = args # <<<<<<<<<<<<<<
2085 *
2086 * else:
2087 */
2088 if (1) {
2089 PyObject* sequence = __pyx_v_args;
2090 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
2091 if (unlikely(size != 4)) {
2092 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
2093 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
2094 __PYX_ERR(0, 58, __pyx_L1_error)
2095 }
2096 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2097 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
2098 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
2099 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2);
2100 __pyx_t_8 = PyTuple_GET_ITEM(sequence, 3);
2101 __Pyx_INCREF(__pyx_t_4);
2102 __Pyx_INCREF(__pyx_t_9);
2103 __Pyx_INCREF(__pyx_t_10);
2104 __Pyx_INCREF(__pyx_t_8);
2105 #else
2106 {
2107 Py_ssize_t i;
2108 PyObject** temps[4] = {&__pyx_t_4,&__pyx_t_9,&__pyx_t_10,&__pyx_t_8};
2109 for (i=0; i < 4; i++) {
2110 PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 58, __pyx_L1_error)
2111 __Pyx_GOTREF(item);
2112 *(temps[i]) = item;
2113 }
2114 }
2115 #endif
2116 }
2117 __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
2118 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2119 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
2120 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2121 __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
2122 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
2123 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
2124 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2125 __pyx_v_x = __pyx_t_14;
2126 __pyx_v_y = __pyx_t_15;
2127 __pyx_v_w = __pyx_t_13;
2128 __pyx_v_h = __pyx_t_6;
2129
2130 /* "pygame_sdl2/rect.pyx":57
2131 * w, h = args[1]
2132 *
2133 * elif len_args == 4: # <<<<<<<<<<<<<<
2134 * x, y, w, h = args
2135 *
2136 */
2137 goto __pyx_L3;
2138 }
2139
2140 /* "pygame_sdl2/rect.pyx":61
2141 *
2142 * else:
2143 * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<<
2144 *
2145 * self.x = x
2146 */
2147 /*else*/ {
2148 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 61, __pyx_L1_error)
2149 __Pyx_GOTREF(__pyx_t_8);
2150 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
2151 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2152 __PYX_ERR(0, 61, __pyx_L1_error)
2153 }
2154 __pyx_L3:;
2155
2156 /* "pygame_sdl2/rect.pyx":63
2157 * raise TypeError("Argument must be a rect style object.")
2158 *
2159 * self.x = x # <<<<<<<<<<<<<<
2160 * self.y = y
2161 * self.w = w
2162 */
2163 __pyx_v_self->x = __pyx_v_x;
2164
2165 /* "pygame_sdl2/rect.pyx":64
2166 *
2167 * self.x = x
2168 * self.y = y # <<<<<<<<<<<<<<
2169 * self.w = w
2170 * self.h = h
2171 */
2172 __pyx_v_self->y = __pyx_v_y;
2173
2174 /* "pygame_sdl2/rect.pyx":65
2175 * self.x = x
2176 * self.y = y
2177 * self.w = w # <<<<<<<<<<<<<<
2178 * self.h = h
2179 *
2180 */
2181 __pyx_v_self->w = __pyx_v_w;
2182
2183 /* "pygame_sdl2/rect.pyx":66
2184 * self.y = y
2185 * self.w = w
2186 * self.h = h # <<<<<<<<<<<<<<
2187 *
2188 * def __reduce__(self):
2189 */
2190 __pyx_v_self->h = __pyx_v_h;
2191
2192 /* "pygame_sdl2/rect.pyx":30
2193 * cdef class Rect:
2194 *
2195 * def __init__(self, *args): # <<<<<<<<<<<<<<
2196 *
2197 * cdef int x, y, w, h
2198 */
2199
2200 /* function exit code */
2201 __pyx_r = 0;
2202 goto __pyx_L0;
2203 __pyx_L1_error:;
2204 __Pyx_XDECREF(__pyx_t_4);
2205 __Pyx_XDECREF(__pyx_t_7);
2206 __Pyx_XDECREF(__pyx_t_8);
2207 __Pyx_XDECREF(__pyx_t_9);
2208 __Pyx_XDECREF(__pyx_t_10);
2209 __Pyx_XDECREF(__pyx_t_11);
2210 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2211 __pyx_r = -1;
2212 __pyx_L0:;
2213 __Pyx_XDECREF((PyObject *)__pyx_v_rect);
2214 __Pyx_RefNannyFinishContext();
2215 return __pyx_r;
2216 }
2217
2218 /* "pygame_sdl2/rect.pyx":68
2219 * self.h = h
2220 *
2221 * def __reduce__(self): # <<<<<<<<<<<<<<
2222 * return (Rect, (self.x, self.y, self.w, self.h))
2223 *
2224 */
2225
2226 /* Python wrapper */
2227 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)2228 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
2229 PyObject *__pyx_r = 0;
2230 __Pyx_RefNannyDeclarations
2231 __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
2232 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
2233
2234 /* function exit code */
2235 __Pyx_RefNannyFinishContext();
2236 return __pyx_r;
2237 }
2238
__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)2239 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_2__reduce__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
2240 PyObject *__pyx_r = NULL;
2241 __Pyx_RefNannyDeclarations
2242 PyObject *__pyx_t_1 = NULL;
2243 PyObject *__pyx_t_2 = NULL;
2244 PyObject *__pyx_t_3 = NULL;
2245 PyObject *__pyx_t_4 = NULL;
2246 PyObject *__pyx_t_5 = NULL;
2247 int __pyx_lineno = 0;
2248 const char *__pyx_filename = NULL;
2249 int __pyx_clineno = 0;
2250 __Pyx_RefNannySetupContext("__reduce__", 0);
2251
2252 /* "pygame_sdl2/rect.pyx":69
2253 *
2254 * def __reduce__(self):
2255 * return (Rect, (self.x, self.y, self.w, self.h)) # <<<<<<<<<<<<<<
2256 *
2257 * def __repr__(self):
2258 */
2259 __Pyx_XDECREF(__pyx_r);
2260 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
2261 __Pyx_GOTREF(__pyx_t_1);
2262 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 69, __pyx_L1_error)
2263 __Pyx_GOTREF(__pyx_t_2);
2264 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 69, __pyx_L1_error)
2265 __Pyx_GOTREF(__pyx_t_3);
2266 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error)
2267 __Pyx_GOTREF(__pyx_t_4);
2268 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error)
2269 __Pyx_GOTREF(__pyx_t_5);
2270 __Pyx_GIVEREF(__pyx_t_1);
2271 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
2272 __Pyx_GIVEREF(__pyx_t_2);
2273 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
2274 __Pyx_GIVEREF(__pyx_t_3);
2275 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
2276 __Pyx_GIVEREF(__pyx_t_4);
2277 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
2278 __pyx_t_1 = 0;
2279 __pyx_t_2 = 0;
2280 __pyx_t_3 = 0;
2281 __pyx_t_4 = 0;
2282 __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 69, __pyx_L1_error)
2283 __Pyx_GOTREF(__pyx_t_4);
2284 __Pyx_INCREF(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect));
2285 __Pyx_GIVEREF(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect));
2286 PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect));
2287 __Pyx_GIVEREF(__pyx_t_5);
2288 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
2289 __pyx_t_5 = 0;
2290 __pyx_r = __pyx_t_4;
2291 __pyx_t_4 = 0;
2292 goto __pyx_L0;
2293
2294 /* "pygame_sdl2/rect.pyx":68
2295 * self.h = h
2296 *
2297 * def __reduce__(self): # <<<<<<<<<<<<<<
2298 * return (Rect, (self.x, self.y, self.w, self.h))
2299 *
2300 */
2301
2302 /* function exit code */
2303 __pyx_L1_error:;
2304 __Pyx_XDECREF(__pyx_t_1);
2305 __Pyx_XDECREF(__pyx_t_2);
2306 __Pyx_XDECREF(__pyx_t_3);
2307 __Pyx_XDECREF(__pyx_t_4);
2308 __Pyx_XDECREF(__pyx_t_5);
2309 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2310 __pyx_r = NULL;
2311 __pyx_L0:;
2312 __Pyx_XGIVEREF(__pyx_r);
2313 __Pyx_RefNannyFinishContext();
2314 return __pyx_r;
2315 }
2316
2317 /* "pygame_sdl2/rect.pyx":71
2318 * return (Rect, (self.x, self.y, self.w, self.h))
2319 *
2320 * def __repr__(self): # <<<<<<<<<<<<<<
2321 * return "<rect(%d, %d, %d, %d)>" % (self.x, self.y, self.w, self.h)
2322 *
2323 */
2324
2325 /* Python wrapper */
2326 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject * __pyx_v_self)2327 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__(PyObject *__pyx_v_self) {
2328 PyObject *__pyx_r = 0;
2329 __Pyx_RefNannyDeclarations
2330 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
2331 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
2332
2333 /* function exit code */
2334 __Pyx_RefNannyFinishContext();
2335 return __pyx_r;
2336 }
2337
__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)2338 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4__repr__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
2339 PyObject *__pyx_r = NULL;
2340 __Pyx_RefNannyDeclarations
2341 PyObject *__pyx_t_1 = NULL;
2342 PyObject *__pyx_t_2 = NULL;
2343 PyObject *__pyx_t_3 = NULL;
2344 PyObject *__pyx_t_4 = NULL;
2345 PyObject *__pyx_t_5 = NULL;
2346 int __pyx_lineno = 0;
2347 const char *__pyx_filename = NULL;
2348 int __pyx_clineno = 0;
2349 __Pyx_RefNannySetupContext("__repr__", 0);
2350
2351 /* "pygame_sdl2/rect.pyx":72
2352 *
2353 * def __repr__(self):
2354 * return "<rect(%d, %d, %d, %d)>" % (self.x, self.y, self.w, self.h) # <<<<<<<<<<<<<<
2355 *
2356 * def __len__(self):
2357 */
2358 __Pyx_XDECREF(__pyx_r);
2359 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
2360 __Pyx_GOTREF(__pyx_t_1);
2361 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
2362 __Pyx_GOTREF(__pyx_t_2);
2363 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 72, __pyx_L1_error)
2364 __Pyx_GOTREF(__pyx_t_3);
2365 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
2366 __Pyx_GOTREF(__pyx_t_4);
2367 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
2368 __Pyx_GOTREF(__pyx_t_5);
2369 __Pyx_GIVEREF(__pyx_t_1);
2370 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
2371 __Pyx_GIVEREF(__pyx_t_2);
2372 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
2373 __Pyx_GIVEREF(__pyx_t_3);
2374 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
2375 __Pyx_GIVEREF(__pyx_t_4);
2376 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
2377 __pyx_t_1 = 0;
2378 __pyx_t_2 = 0;
2379 __pyx_t_3 = 0;
2380 __pyx_t_4 = 0;
2381 __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_rect_d_d_d_d, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
2382 __Pyx_GOTREF(__pyx_t_4);
2383 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2384 __pyx_r = __pyx_t_4;
2385 __pyx_t_4 = 0;
2386 goto __pyx_L0;
2387
2388 /* "pygame_sdl2/rect.pyx":71
2389 * return (Rect, (self.x, self.y, self.w, self.h))
2390 *
2391 * def __repr__(self): # <<<<<<<<<<<<<<
2392 * return "<rect(%d, %d, %d, %d)>" % (self.x, self.y, self.w, self.h)
2393 *
2394 */
2395
2396 /* function exit code */
2397 __pyx_L1_error:;
2398 __Pyx_XDECREF(__pyx_t_1);
2399 __Pyx_XDECREF(__pyx_t_2);
2400 __Pyx_XDECREF(__pyx_t_3);
2401 __Pyx_XDECREF(__pyx_t_4);
2402 __Pyx_XDECREF(__pyx_t_5);
2403 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2404 __pyx_r = NULL;
2405 __pyx_L0:;
2406 __Pyx_XGIVEREF(__pyx_r);
2407 __Pyx_RefNannyFinishContext();
2408 return __pyx_r;
2409 }
2410
2411 /* "pygame_sdl2/rect.pyx":74
2412 * return "<rect(%d, %d, %d, %d)>" % (self.x, self.y, self.w, self.h)
2413 *
2414 * def __len__(self): # <<<<<<<<<<<<<<
2415 * return 4
2416 *
2417 */
2418
2419 /* Python wrapper */
2420 static Py_ssize_t __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject * __pyx_v_self)2421 static Py_ssize_t __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__(PyObject *__pyx_v_self) {
2422 Py_ssize_t __pyx_r;
2423 __Pyx_RefNannyDeclarations
2424 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
2425 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
2426
2427 /* function exit code */
2428 __Pyx_RefNannyFinishContext();
2429 return __pyx_r;
2430 }
2431
__pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)2432 static Py_ssize_t __pyx_pf_11pygame_sdl2_4rect_4Rect_6__len__(CYTHON_UNUSED struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
2433 Py_ssize_t __pyx_r;
2434 __Pyx_RefNannyDeclarations
2435 __Pyx_RefNannySetupContext("__len__", 0);
2436
2437 /* "pygame_sdl2/rect.pyx":75
2438 *
2439 * def __len__(self):
2440 * return 4 # <<<<<<<<<<<<<<
2441 *
2442 * def __iter__(self):
2443 */
2444 __pyx_r = 4;
2445 goto __pyx_L0;
2446
2447 /* "pygame_sdl2/rect.pyx":74
2448 * return "<rect(%d, %d, %d, %d)>" % (self.x, self.y, self.w, self.h)
2449 *
2450 * def __len__(self): # <<<<<<<<<<<<<<
2451 * return 4
2452 *
2453 */
2454
2455 /* function exit code */
2456 __pyx_L0:;
2457 __Pyx_RefNannyFinishContext();
2458 return __pyx_r;
2459 }
2460
2461 /* "pygame_sdl2/rect.pyx":77
2462 * return 4
2463 *
2464 * def __iter__(self): # <<<<<<<<<<<<<<
2465 * return iter((self.x, self.y, self.w, self.h))
2466 *
2467 */
2468
2469 /* Python wrapper */
2470 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject * __pyx_v_self)2471 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__(PyObject *__pyx_v_self) {
2472 PyObject *__pyx_r = 0;
2473 __Pyx_RefNannyDeclarations
2474 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
2475 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
2476
2477 /* function exit code */
2478 __Pyx_RefNannyFinishContext();
2479 return __pyx_r;
2480 }
2481
__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)2482 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8__iter__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
2483 PyObject *__pyx_r = NULL;
2484 __Pyx_RefNannyDeclarations
2485 PyObject *__pyx_t_1 = NULL;
2486 PyObject *__pyx_t_2 = NULL;
2487 PyObject *__pyx_t_3 = NULL;
2488 PyObject *__pyx_t_4 = NULL;
2489 PyObject *__pyx_t_5 = NULL;
2490 int __pyx_lineno = 0;
2491 const char *__pyx_filename = NULL;
2492 int __pyx_clineno = 0;
2493 __Pyx_RefNannySetupContext("__iter__", 0);
2494
2495 /* "pygame_sdl2/rect.pyx":78
2496 *
2497 * def __iter__(self):
2498 * return iter((self.x, self.y, self.w, self.h)) # <<<<<<<<<<<<<<
2499 *
2500 * def __richcmp__(Rect a, b, int op):
2501 */
2502 __Pyx_XDECREF(__pyx_r);
2503 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 78, __pyx_L1_error)
2504 __Pyx_GOTREF(__pyx_t_1);
2505 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 78, __pyx_L1_error)
2506 __Pyx_GOTREF(__pyx_t_2);
2507 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 78, __pyx_L1_error)
2508 __Pyx_GOTREF(__pyx_t_3);
2509 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
2510 __Pyx_GOTREF(__pyx_t_4);
2511 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
2512 __Pyx_GOTREF(__pyx_t_5);
2513 __Pyx_GIVEREF(__pyx_t_1);
2514 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
2515 __Pyx_GIVEREF(__pyx_t_2);
2516 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
2517 __Pyx_GIVEREF(__pyx_t_3);
2518 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
2519 __Pyx_GIVEREF(__pyx_t_4);
2520 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
2521 __pyx_t_1 = 0;
2522 __pyx_t_2 = 0;
2523 __pyx_t_3 = 0;
2524 __pyx_t_4 = 0;
2525 __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 78, __pyx_L1_error)
2526 __Pyx_GOTREF(__pyx_t_4);
2527 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2528 __pyx_r = __pyx_t_4;
2529 __pyx_t_4 = 0;
2530 goto __pyx_L0;
2531
2532 /* "pygame_sdl2/rect.pyx":77
2533 * return 4
2534 *
2535 * def __iter__(self): # <<<<<<<<<<<<<<
2536 * return iter((self.x, self.y, self.w, self.h))
2537 *
2538 */
2539
2540 /* function exit code */
2541 __pyx_L1_error:;
2542 __Pyx_XDECREF(__pyx_t_1);
2543 __Pyx_XDECREF(__pyx_t_2);
2544 __Pyx_XDECREF(__pyx_t_3);
2545 __Pyx_XDECREF(__pyx_t_4);
2546 __Pyx_XDECREF(__pyx_t_5);
2547 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2548 __pyx_r = NULL;
2549 __pyx_L0:;
2550 __Pyx_XGIVEREF(__pyx_r);
2551 __Pyx_RefNannyFinishContext();
2552 return __pyx_r;
2553 }
2554
2555 /* "pygame_sdl2/rect.pyx":80
2556 * return iter((self.x, self.y, self.w, self.h))
2557 *
2558 * def __richcmp__(Rect a, b, int op): # <<<<<<<<<<<<<<
2559 * if not isinstance(b, Rect):
2560 * b = Rect(b)
2561 */
2562
2563 /* Python wrapper */
2564 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject * __pyx_v_a,PyObject * __pyx_v_b,int __pyx_v_op)2565 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__(PyObject *__pyx_v_a, PyObject *__pyx_v_b, int __pyx_v_op) {
2566 PyObject *__pyx_r = 0;
2567 __Pyx_RefNannyDeclarations
2568 __Pyx_RefNannySetupContext("__richcmp__ (wrapper)", 0);
2569 __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));
2570
2571 /* function exit code */
2572 __Pyx_RefNannyFinishContext();
2573 return __pyx_r;
2574 }
2575
__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)2576 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) {
2577 PyObject *__pyx_r = NULL;
2578 __Pyx_RefNannyDeclarations
2579 int __pyx_t_1;
2580 int __pyx_t_2;
2581 PyObject *__pyx_t_3 = NULL;
2582 PyObject *__pyx_t_4 = NULL;
2583 PyObject *__pyx_t_5 = NULL;
2584 PyObject *__pyx_t_6 = NULL;
2585 int __pyx_lineno = 0;
2586 const char *__pyx_filename = NULL;
2587 int __pyx_clineno = 0;
2588 __Pyx_RefNannySetupContext("__richcmp__", 0);
2589 __Pyx_INCREF(__pyx_v_b);
2590
2591 /* "pygame_sdl2/rect.pyx":81
2592 *
2593 * def __richcmp__(Rect a, b, int op):
2594 * if not isinstance(b, Rect): # <<<<<<<<<<<<<<
2595 * b = Rect(b)
2596 * if op == 2:
2597 */
2598 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_b, __pyx_ptype_11pygame_sdl2_4rect_Rect);
2599 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
2600 if (__pyx_t_2) {
2601
2602 /* "pygame_sdl2/rect.pyx":82
2603 * def __richcmp__(Rect a, b, int op):
2604 * if not isinstance(b, Rect):
2605 * b = Rect(b) # <<<<<<<<<<<<<<
2606 * if op == 2:
2607 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h
2608 */
2609 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 82, __pyx_L1_error)
2610 __Pyx_GOTREF(__pyx_t_3);
2611 __Pyx_DECREF_SET(__pyx_v_b, __pyx_t_3);
2612 __pyx_t_3 = 0;
2613
2614 /* "pygame_sdl2/rect.pyx":81
2615 *
2616 * def __richcmp__(Rect a, b, int op):
2617 * if not isinstance(b, Rect): # <<<<<<<<<<<<<<
2618 * b = Rect(b)
2619 * if op == 2:
2620 */
2621 }
2622
2623 /* "pygame_sdl2/rect.pyx":83
2624 * if not isinstance(b, Rect):
2625 * b = Rect(b)
2626 * if op == 2: # <<<<<<<<<<<<<<
2627 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h
2628 *
2629 */
2630 __pyx_t_2 = ((__pyx_v_op == 2) != 0);
2631 if (__pyx_t_2) {
2632
2633 /* "pygame_sdl2/rect.pyx":84
2634 * b = Rect(b)
2635 * if op == 2:
2636 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h # <<<<<<<<<<<<<<
2637 *
2638 * def __getitem__(self, key):
2639 */
2640 __Pyx_XDECREF(__pyx_r);
2641 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_a->x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
2642 __Pyx_GOTREF(__pyx_t_4);
2643 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
2644 __Pyx_GOTREF(__pyx_t_5);
2645 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
2646 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2647 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2648 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
2649 if (__pyx_t_2) {
2650 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2651 } else {
2652 __Pyx_INCREF(__pyx_t_6);
2653 __pyx_t_3 = __pyx_t_6;
2654 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2655 goto __pyx_L5_bool_binop_done;
2656 }
2657 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_a->y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
2658 __Pyx_GOTREF(__pyx_t_6);
2659 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
2660 __Pyx_GOTREF(__pyx_t_5);
2661 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
2662 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2663 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2664 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
2665 if (__pyx_t_2) {
2666 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2667 } else {
2668 __Pyx_INCREF(__pyx_t_4);
2669 __pyx_t_3 = __pyx_t_4;
2670 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2671 goto __pyx_L5_bool_binop_done;
2672 }
2673 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_a->w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
2674 __Pyx_GOTREF(__pyx_t_4);
2675 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
2676 __Pyx_GOTREF(__pyx_t_5);
2677 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
2678 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2679 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2680 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
2681 if (__pyx_t_2) {
2682 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2683 } else {
2684 __Pyx_INCREF(__pyx_t_6);
2685 __pyx_t_3 = __pyx_t_6;
2686 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2687 goto __pyx_L5_bool_binop_done;
2688 }
2689 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_a->h); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 84, __pyx_L1_error)
2690 __Pyx_GOTREF(__pyx_t_6);
2691 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_b, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
2692 __Pyx_GOTREF(__pyx_t_5);
2693 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
2694 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2695 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2696 __Pyx_INCREF(__pyx_t_4);
2697 __pyx_t_3 = __pyx_t_4;
2698 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2699 __pyx_L5_bool_binop_done:;
2700 __pyx_r = __pyx_t_3;
2701 __pyx_t_3 = 0;
2702 goto __pyx_L0;
2703
2704 /* "pygame_sdl2/rect.pyx":83
2705 * if not isinstance(b, Rect):
2706 * b = Rect(b)
2707 * if op == 2: # <<<<<<<<<<<<<<
2708 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h
2709 *
2710 */
2711 }
2712
2713 /* "pygame_sdl2/rect.pyx":80
2714 * return iter((self.x, self.y, self.w, self.h))
2715 *
2716 * def __richcmp__(Rect a, b, int op): # <<<<<<<<<<<<<<
2717 * if not isinstance(b, Rect):
2718 * b = Rect(b)
2719 */
2720
2721 /* function exit code */
2722 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2723 goto __pyx_L0;
2724 __pyx_L1_error:;
2725 __Pyx_XDECREF(__pyx_t_3);
2726 __Pyx_XDECREF(__pyx_t_4);
2727 __Pyx_XDECREF(__pyx_t_5);
2728 __Pyx_XDECREF(__pyx_t_6);
2729 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__richcmp__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2730 __pyx_r = NULL;
2731 __pyx_L0:;
2732 __Pyx_XDECREF(__pyx_v_b);
2733 __Pyx_XGIVEREF(__pyx_r);
2734 __Pyx_RefNannyFinishContext();
2735 return __pyx_r;
2736 }
2737
2738 /* "pygame_sdl2/rect.pyx":86
2739 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h
2740 *
2741 * def __getitem__(self, key): # <<<<<<<<<<<<<<
2742 * return (self.x, self.y, self.w, self.h)[key]
2743 *
2744 */
2745
2746 /* Python wrapper */
2747 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_key)2748 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
2749 PyObject *__pyx_r = 0;
2750 __Pyx_RefNannyDeclarations
2751 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
2752 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_key));
2753
2754 /* function exit code */
2755 __Pyx_RefNannyFinishContext();
2756 return __pyx_r;
2757 }
2758
__pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_key)2759 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_12__getitem__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_key) {
2760 PyObject *__pyx_r = NULL;
2761 __Pyx_RefNannyDeclarations
2762 PyObject *__pyx_t_1 = NULL;
2763 PyObject *__pyx_t_2 = NULL;
2764 PyObject *__pyx_t_3 = NULL;
2765 PyObject *__pyx_t_4 = NULL;
2766 PyObject *__pyx_t_5 = NULL;
2767 int __pyx_lineno = 0;
2768 const char *__pyx_filename = NULL;
2769 int __pyx_clineno = 0;
2770 __Pyx_RefNannySetupContext("__getitem__", 0);
2771
2772 /* "pygame_sdl2/rect.pyx":87
2773 *
2774 * def __getitem__(self, key):
2775 * return (self.x, self.y, self.w, self.h)[key] # <<<<<<<<<<<<<<
2776 *
2777 * def __setitem__(self, key, val):
2778 */
2779 __Pyx_XDECREF(__pyx_r);
2780 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
2781 __Pyx_GOTREF(__pyx_t_1);
2782 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
2783 __Pyx_GOTREF(__pyx_t_2);
2784 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 87, __pyx_L1_error)
2785 __Pyx_GOTREF(__pyx_t_3);
2786 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
2787 __Pyx_GOTREF(__pyx_t_4);
2788 __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)
2789 __Pyx_GOTREF(__pyx_t_5);
2790 __Pyx_GIVEREF(__pyx_t_1);
2791 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
2792 __Pyx_GIVEREF(__pyx_t_2);
2793 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
2794 __Pyx_GIVEREF(__pyx_t_3);
2795 PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
2796 __Pyx_GIVEREF(__pyx_t_4);
2797 PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
2798 __pyx_t_1 = 0;
2799 __pyx_t_2 = 0;
2800 __pyx_t_3 = 0;
2801 __pyx_t_4 = 0;
2802 __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 87, __pyx_L1_error)
2803 __Pyx_GOTREF(__pyx_t_4);
2804 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2805 __pyx_r = __pyx_t_4;
2806 __pyx_t_4 = 0;
2807 goto __pyx_L0;
2808
2809 /* "pygame_sdl2/rect.pyx":86
2810 * return a.x == b.x and a.y == b.y and a.w == b.w and a.h == b.h
2811 *
2812 * def __getitem__(self, key): # <<<<<<<<<<<<<<
2813 * return (self.x, self.y, self.w, self.h)[key]
2814 *
2815 */
2816
2817 /* function exit code */
2818 __pyx_L1_error:;
2819 __Pyx_XDECREF(__pyx_t_1);
2820 __Pyx_XDECREF(__pyx_t_2);
2821 __Pyx_XDECREF(__pyx_t_3);
2822 __Pyx_XDECREF(__pyx_t_4);
2823 __Pyx_XDECREF(__pyx_t_5);
2824 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2825 __pyx_r = NULL;
2826 __pyx_L0:;
2827 __Pyx_XGIVEREF(__pyx_r);
2828 __Pyx_RefNannyFinishContext();
2829 return __pyx_r;
2830 }
2831
2832 /* "pygame_sdl2/rect.pyx":89
2833 * return (self.x, self.y, self.w, self.h)[key]
2834 *
2835 * def __setitem__(self, key, val): # <<<<<<<<<<<<<<
2836 * if key == 0:
2837 * self.x = val
2838 */
2839
2840 /* Python wrapper */
2841 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_key,PyObject * __pyx_v_val)2842 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_val) {
2843 int __pyx_r;
2844 __Pyx_RefNannyDeclarations
2845 __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
2846 __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));
2847
2848 /* function exit code */
2849 __Pyx_RefNannyFinishContext();
2850 return __pyx_r;
2851 }
2852
__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)2853 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) {
2854 int __pyx_r;
2855 __Pyx_RefNannyDeclarations
2856 PyObject *__pyx_t_1 = NULL;
2857 int __pyx_t_2;
2858 int __pyx_t_3;
2859 int __pyx_lineno = 0;
2860 const char *__pyx_filename = NULL;
2861 int __pyx_clineno = 0;
2862 __Pyx_RefNannySetupContext("__setitem__", 0);
2863
2864 /* "pygame_sdl2/rect.pyx":90
2865 *
2866 * def __setitem__(self, key, val):
2867 * if key == 0: # <<<<<<<<<<<<<<
2868 * self.x = val
2869 * elif key == 1:
2870 */
2871 __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
2872 __Pyx_GOTREF(__pyx_t_1);
2873 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 90, __pyx_L1_error)
2874 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2875 if (__pyx_t_2) {
2876
2877 /* "pygame_sdl2/rect.pyx":91
2878 * def __setitem__(self, key, val):
2879 * if key == 0:
2880 * self.x = val # <<<<<<<<<<<<<<
2881 * elif key == 1:
2882 * self.y = val
2883 */
2884 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 91, __pyx_L1_error)
2885 __pyx_v_self->x = __pyx_t_3;
2886
2887 /* "pygame_sdl2/rect.pyx":90
2888 *
2889 * def __setitem__(self, key, val):
2890 * if key == 0: # <<<<<<<<<<<<<<
2891 * self.x = val
2892 * elif key == 1:
2893 */
2894 goto __pyx_L3;
2895 }
2896
2897 /* "pygame_sdl2/rect.pyx":92
2898 * if key == 0:
2899 * self.x = val
2900 * elif key == 1: # <<<<<<<<<<<<<<
2901 * self.y = val
2902 * elif key == 2:
2903 */
2904 __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
2905 __Pyx_GOTREF(__pyx_t_1);
2906 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 92, __pyx_L1_error)
2907 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2908 if (__pyx_t_2) {
2909
2910 /* "pygame_sdl2/rect.pyx":93
2911 * self.x = val
2912 * elif key == 1:
2913 * self.y = val # <<<<<<<<<<<<<<
2914 * elif key == 2:
2915 * self.w = val
2916 */
2917 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 93, __pyx_L1_error)
2918 __pyx_v_self->y = __pyx_t_3;
2919
2920 /* "pygame_sdl2/rect.pyx":92
2921 * if key == 0:
2922 * self.x = val
2923 * elif key == 1: # <<<<<<<<<<<<<<
2924 * self.y = val
2925 * elif key == 2:
2926 */
2927 goto __pyx_L3;
2928 }
2929
2930 /* "pygame_sdl2/rect.pyx":94
2931 * elif key == 1:
2932 * self.y = val
2933 * elif key == 2: # <<<<<<<<<<<<<<
2934 * self.w = val
2935 * elif key == 3:
2936 */
2937 __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 94, __pyx_L1_error)
2938 __Pyx_GOTREF(__pyx_t_1);
2939 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 94, __pyx_L1_error)
2940 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2941 if (__pyx_t_2) {
2942
2943 /* "pygame_sdl2/rect.pyx":95
2944 * self.y = val
2945 * elif key == 2:
2946 * self.w = val # <<<<<<<<<<<<<<
2947 * elif key == 3:
2948 * self.h = val
2949 */
2950 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 95, __pyx_L1_error)
2951 __pyx_v_self->w = __pyx_t_3;
2952
2953 /* "pygame_sdl2/rect.pyx":94
2954 * elif key == 1:
2955 * self.y = val
2956 * elif key == 2: # <<<<<<<<<<<<<<
2957 * self.w = val
2958 * elif key == 3:
2959 */
2960 goto __pyx_L3;
2961 }
2962
2963 /* "pygame_sdl2/rect.pyx":96
2964 * elif key == 2:
2965 * self.w = val
2966 * elif key == 3: # <<<<<<<<<<<<<<
2967 * self.h = val
2968 * else:
2969 */
2970 __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_key, __pyx_int_3, 3, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
2971 __Pyx_GOTREF(__pyx_t_1);
2972 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 96, __pyx_L1_error)
2973 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2974 if (likely(__pyx_t_2)) {
2975
2976 /* "pygame_sdl2/rect.pyx":97
2977 * self.w = val
2978 * elif key == 3:
2979 * self.h = val # <<<<<<<<<<<<<<
2980 * else:
2981 * raise IndexError(key)
2982 */
2983 __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 97, __pyx_L1_error)
2984 __pyx_v_self->h = __pyx_t_3;
2985
2986 /* "pygame_sdl2/rect.pyx":96
2987 * elif key == 2:
2988 * self.w = val
2989 * elif key == 3: # <<<<<<<<<<<<<<
2990 * self.h = val
2991 * else:
2992 */
2993 goto __pyx_L3;
2994 }
2995
2996 /* "pygame_sdl2/rect.pyx":99
2997 * self.h = val
2998 * else:
2999 * raise IndexError(key) # <<<<<<<<<<<<<<
3000 *
3001 * property left:
3002 */
3003 /*else*/ {
3004 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
3005 __Pyx_GOTREF(__pyx_t_1);
3006 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3007 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3008 __PYX_ERR(0, 99, __pyx_L1_error)
3009 }
3010 __pyx_L3:;
3011
3012 /* "pygame_sdl2/rect.pyx":89
3013 * return (self.x, self.y, self.w, self.h)[key]
3014 *
3015 * def __setitem__(self, key, val): # <<<<<<<<<<<<<<
3016 * if key == 0:
3017 * self.x = val
3018 */
3019
3020 /* function exit code */
3021 __pyx_r = 0;
3022 goto __pyx_L0;
3023 __pyx_L1_error:;
3024 __Pyx_XDECREF(__pyx_t_1);
3025 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3026 __pyx_r = -1;
3027 __pyx_L0:;
3028 __Pyx_RefNannyFinishContext();
3029 return __pyx_r;
3030 }
3031
3032 /* "pygame_sdl2/rect.pyx":102
3033 *
3034 * property left:
3035 * def __get__(self): # <<<<<<<<<<<<<<
3036 * return self.x
3037 * def __set__(self, val):
3038 */
3039
3040 /* Python wrapper */
3041 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject * __pyx_v_self)3042 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(PyObject *__pyx_v_self) {
3043 PyObject *__pyx_r = 0;
3044 __Pyx_RefNannyDeclarations
3045 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3046 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
3047
3048 /* function exit code */
3049 __Pyx_RefNannyFinishContext();
3050 return __pyx_r;
3051 }
3052
__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)3053 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4left___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
3054 PyObject *__pyx_r = NULL;
3055 __Pyx_RefNannyDeclarations
3056 PyObject *__pyx_t_1 = NULL;
3057 int __pyx_lineno = 0;
3058 const char *__pyx_filename = NULL;
3059 int __pyx_clineno = 0;
3060 __Pyx_RefNannySetupContext("__get__", 0);
3061
3062 /* "pygame_sdl2/rect.pyx":103
3063 * property left:
3064 * def __get__(self):
3065 * return self.x # <<<<<<<<<<<<<<
3066 * def __set__(self, val):
3067 * self.x = val
3068 */
3069 __Pyx_XDECREF(__pyx_r);
3070 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 103, __pyx_L1_error)
3071 __Pyx_GOTREF(__pyx_t_1);
3072 __pyx_r = __pyx_t_1;
3073 __pyx_t_1 = 0;
3074 goto __pyx_L0;
3075
3076 /* "pygame_sdl2/rect.pyx":102
3077 *
3078 * property left:
3079 * def __get__(self): # <<<<<<<<<<<<<<
3080 * return self.x
3081 * def __set__(self, val):
3082 */
3083
3084 /* function exit code */
3085 __pyx_L1_error:;
3086 __Pyx_XDECREF(__pyx_t_1);
3087 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.left.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3088 __pyx_r = NULL;
3089 __pyx_L0:;
3090 __Pyx_XGIVEREF(__pyx_r);
3091 __Pyx_RefNannyFinishContext();
3092 return __pyx_r;
3093 }
3094
3095 /* "pygame_sdl2/rect.pyx":104
3096 * def __get__(self):
3097 * return self.x
3098 * def __set__(self, val): # <<<<<<<<<<<<<<
3099 * self.x = val
3100 *
3101 */
3102
3103 /* Python wrapper */
3104 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)3105 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
3106 int __pyx_r;
3107 __Pyx_RefNannyDeclarations
3108 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3109 __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));
3110
3111 /* function exit code */
3112 __Pyx_RefNannyFinishContext();
3113 return __pyx_r;
3114 }
3115
__pyx_pf_11pygame_sdl2_4rect_4Rect_4left_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)3116 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) {
3117 int __pyx_r;
3118 __Pyx_RefNannyDeclarations
3119 int __pyx_t_1;
3120 int __pyx_lineno = 0;
3121 const char *__pyx_filename = NULL;
3122 int __pyx_clineno = 0;
3123 __Pyx_RefNannySetupContext("__set__", 0);
3124
3125 /* "pygame_sdl2/rect.pyx":105
3126 * return self.x
3127 * def __set__(self, val):
3128 * self.x = val # <<<<<<<<<<<<<<
3129 *
3130 * property top:
3131 */
3132 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 105, __pyx_L1_error)
3133 __pyx_v_self->x = __pyx_t_1;
3134
3135 /* "pygame_sdl2/rect.pyx":104
3136 * def __get__(self):
3137 * return self.x
3138 * def __set__(self, val): # <<<<<<<<<<<<<<
3139 * self.x = val
3140 *
3141 */
3142
3143 /* function exit code */
3144 __pyx_r = 0;
3145 goto __pyx_L0;
3146 __pyx_L1_error:;
3147 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.left.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3148 __pyx_r = -1;
3149 __pyx_L0:;
3150 __Pyx_RefNannyFinishContext();
3151 return __pyx_r;
3152 }
3153
3154 /* "pygame_sdl2/rect.pyx":108
3155 *
3156 * property top:
3157 * def __get__(self): # <<<<<<<<<<<<<<
3158 * return self.y
3159 * def __set__(self, val):
3160 */
3161
3162 /* Python wrapper */
3163 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject * __pyx_v_self)3164 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(PyObject *__pyx_v_self) {
3165 PyObject *__pyx_r = 0;
3166 __Pyx_RefNannyDeclarations
3167 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3168 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
3169
3170 /* function exit code */
3171 __Pyx_RefNannyFinishContext();
3172 return __pyx_r;
3173 }
3174
__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)3175 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_3top___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
3176 PyObject *__pyx_r = NULL;
3177 __Pyx_RefNannyDeclarations
3178 PyObject *__pyx_t_1 = NULL;
3179 int __pyx_lineno = 0;
3180 const char *__pyx_filename = NULL;
3181 int __pyx_clineno = 0;
3182 __Pyx_RefNannySetupContext("__get__", 0);
3183
3184 /* "pygame_sdl2/rect.pyx":109
3185 * property top:
3186 * def __get__(self):
3187 * return self.y # <<<<<<<<<<<<<<
3188 * def __set__(self, val):
3189 * self.y = val
3190 */
3191 __Pyx_XDECREF(__pyx_r);
3192 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 109, __pyx_L1_error)
3193 __Pyx_GOTREF(__pyx_t_1);
3194 __pyx_r = __pyx_t_1;
3195 __pyx_t_1 = 0;
3196 goto __pyx_L0;
3197
3198 /* "pygame_sdl2/rect.pyx":108
3199 *
3200 * property top:
3201 * def __get__(self): # <<<<<<<<<<<<<<
3202 * return self.y
3203 * def __set__(self, val):
3204 */
3205
3206 /* function exit code */
3207 __pyx_L1_error:;
3208 __Pyx_XDECREF(__pyx_t_1);
3209 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.top.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3210 __pyx_r = NULL;
3211 __pyx_L0:;
3212 __Pyx_XGIVEREF(__pyx_r);
3213 __Pyx_RefNannyFinishContext();
3214 return __pyx_r;
3215 }
3216
3217 /* "pygame_sdl2/rect.pyx":110
3218 * def __get__(self):
3219 * return self.y
3220 * def __set__(self, val): # <<<<<<<<<<<<<<
3221 * self.y = val
3222 *
3223 */
3224
3225 /* Python wrapper */
3226 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)3227 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
3228 int __pyx_r;
3229 __Pyx_RefNannyDeclarations
3230 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3231 __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));
3232
3233 /* function exit code */
3234 __Pyx_RefNannyFinishContext();
3235 return __pyx_r;
3236 }
3237
__pyx_pf_11pygame_sdl2_4rect_4Rect_3top_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)3238 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) {
3239 int __pyx_r;
3240 __Pyx_RefNannyDeclarations
3241 int __pyx_t_1;
3242 int __pyx_lineno = 0;
3243 const char *__pyx_filename = NULL;
3244 int __pyx_clineno = 0;
3245 __Pyx_RefNannySetupContext("__set__", 0);
3246
3247 /* "pygame_sdl2/rect.pyx":111
3248 * return self.y
3249 * def __set__(self, val):
3250 * self.y = val # <<<<<<<<<<<<<<
3251 *
3252 * property width:
3253 */
3254 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 111, __pyx_L1_error)
3255 __pyx_v_self->y = __pyx_t_1;
3256
3257 /* "pygame_sdl2/rect.pyx":110
3258 * def __get__(self):
3259 * return self.y
3260 * def __set__(self, val): # <<<<<<<<<<<<<<
3261 * self.y = val
3262 *
3263 */
3264
3265 /* function exit code */
3266 __pyx_r = 0;
3267 goto __pyx_L0;
3268 __pyx_L1_error:;
3269 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.top.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3270 __pyx_r = -1;
3271 __pyx_L0:;
3272 __Pyx_RefNannyFinishContext();
3273 return __pyx_r;
3274 }
3275
3276 /* "pygame_sdl2/rect.pyx":114
3277 *
3278 * property width:
3279 * def __get__(self): # <<<<<<<<<<<<<<
3280 * return self.w
3281 * def __set__(self, val):
3282 */
3283
3284 /* Python wrapper */
3285 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject * __pyx_v_self)3286 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(PyObject *__pyx_v_self) {
3287 PyObject *__pyx_r = 0;
3288 __Pyx_RefNannyDeclarations
3289 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3290 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
3291
3292 /* function exit code */
3293 __Pyx_RefNannyFinishContext();
3294 return __pyx_r;
3295 }
3296
__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)3297 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5width___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
3298 PyObject *__pyx_r = NULL;
3299 __Pyx_RefNannyDeclarations
3300 PyObject *__pyx_t_1 = NULL;
3301 int __pyx_lineno = 0;
3302 const char *__pyx_filename = NULL;
3303 int __pyx_clineno = 0;
3304 __Pyx_RefNannySetupContext("__get__", 0);
3305
3306 /* "pygame_sdl2/rect.pyx":115
3307 * property width:
3308 * def __get__(self):
3309 * return self.w # <<<<<<<<<<<<<<
3310 * def __set__(self, val):
3311 * self.w = val
3312 */
3313 __Pyx_XDECREF(__pyx_r);
3314 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
3315 __Pyx_GOTREF(__pyx_t_1);
3316 __pyx_r = __pyx_t_1;
3317 __pyx_t_1 = 0;
3318 goto __pyx_L0;
3319
3320 /* "pygame_sdl2/rect.pyx":114
3321 *
3322 * property width:
3323 * def __get__(self): # <<<<<<<<<<<<<<
3324 * return self.w
3325 * def __set__(self, val):
3326 */
3327
3328 /* function exit code */
3329 __pyx_L1_error:;
3330 __Pyx_XDECREF(__pyx_t_1);
3331 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3332 __pyx_r = NULL;
3333 __pyx_L0:;
3334 __Pyx_XGIVEREF(__pyx_r);
3335 __Pyx_RefNannyFinishContext();
3336 return __pyx_r;
3337 }
3338
3339 /* "pygame_sdl2/rect.pyx":116
3340 * def __get__(self):
3341 * return self.w
3342 * def __set__(self, val): # <<<<<<<<<<<<<<
3343 * self.w = val
3344 *
3345 */
3346
3347 /* Python wrapper */
3348 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)3349 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
3350 int __pyx_r;
3351 __Pyx_RefNannyDeclarations
3352 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3353 __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));
3354
3355 /* function exit code */
3356 __Pyx_RefNannyFinishContext();
3357 return __pyx_r;
3358 }
3359
__pyx_pf_11pygame_sdl2_4rect_4Rect_5width_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)3360 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) {
3361 int __pyx_r;
3362 __Pyx_RefNannyDeclarations
3363 int __pyx_t_1;
3364 int __pyx_lineno = 0;
3365 const char *__pyx_filename = NULL;
3366 int __pyx_clineno = 0;
3367 __Pyx_RefNannySetupContext("__set__", 0);
3368
3369 /* "pygame_sdl2/rect.pyx":117
3370 * return self.w
3371 * def __set__(self, val):
3372 * self.w = val # <<<<<<<<<<<<<<
3373 *
3374 * property height:
3375 */
3376 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
3377 __pyx_v_self->w = __pyx_t_1;
3378
3379 /* "pygame_sdl2/rect.pyx":116
3380 * def __get__(self):
3381 * return self.w
3382 * def __set__(self, val): # <<<<<<<<<<<<<<
3383 * self.w = val
3384 *
3385 */
3386
3387 /* function exit code */
3388 __pyx_r = 0;
3389 goto __pyx_L0;
3390 __pyx_L1_error:;
3391 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3392 __pyx_r = -1;
3393 __pyx_L0:;
3394 __Pyx_RefNannyFinishContext();
3395 return __pyx_r;
3396 }
3397
3398 /* "pygame_sdl2/rect.pyx":120
3399 *
3400 * property height:
3401 * def __get__(self): # <<<<<<<<<<<<<<
3402 * return self.h
3403 * def __set__(self, val):
3404 */
3405
3406 /* Python wrapper */
3407 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject * __pyx_v_self)3408 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(PyObject *__pyx_v_self) {
3409 PyObject *__pyx_r = 0;
3410 __Pyx_RefNannyDeclarations
3411 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3412 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
3413
3414 /* function exit code */
3415 __Pyx_RefNannyFinishContext();
3416 return __pyx_r;
3417 }
3418
__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)3419 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6height___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
3420 PyObject *__pyx_r = NULL;
3421 __Pyx_RefNannyDeclarations
3422 PyObject *__pyx_t_1 = NULL;
3423 int __pyx_lineno = 0;
3424 const char *__pyx_filename = NULL;
3425 int __pyx_clineno = 0;
3426 __Pyx_RefNannySetupContext("__get__", 0);
3427
3428 /* "pygame_sdl2/rect.pyx":121
3429 * property height:
3430 * def __get__(self):
3431 * return self.h # <<<<<<<<<<<<<<
3432 * def __set__(self, val):
3433 * self.h = val
3434 */
3435 __Pyx_XDECREF(__pyx_r);
3436 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
3437 __Pyx_GOTREF(__pyx_t_1);
3438 __pyx_r = __pyx_t_1;
3439 __pyx_t_1 = 0;
3440 goto __pyx_L0;
3441
3442 /* "pygame_sdl2/rect.pyx":120
3443 *
3444 * property height:
3445 * def __get__(self): # <<<<<<<<<<<<<<
3446 * return self.h
3447 * def __set__(self, val):
3448 */
3449
3450 /* function exit code */
3451 __pyx_L1_error:;
3452 __Pyx_XDECREF(__pyx_t_1);
3453 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.height.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3454 __pyx_r = NULL;
3455 __pyx_L0:;
3456 __Pyx_XGIVEREF(__pyx_r);
3457 __Pyx_RefNannyFinishContext();
3458 return __pyx_r;
3459 }
3460
3461 /* "pygame_sdl2/rect.pyx":122
3462 * def __get__(self):
3463 * return self.h
3464 * def __set__(self, val): # <<<<<<<<<<<<<<
3465 * self.h = val
3466 *
3467 */
3468
3469 /* Python wrapper */
3470 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)3471 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
3472 int __pyx_r;
3473 __Pyx_RefNannyDeclarations
3474 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3475 __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));
3476
3477 /* function exit code */
3478 __Pyx_RefNannyFinishContext();
3479 return __pyx_r;
3480 }
3481
__pyx_pf_11pygame_sdl2_4rect_4Rect_6height_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)3482 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) {
3483 int __pyx_r;
3484 __Pyx_RefNannyDeclarations
3485 int __pyx_t_1;
3486 int __pyx_lineno = 0;
3487 const char *__pyx_filename = NULL;
3488 int __pyx_clineno = 0;
3489 __Pyx_RefNannySetupContext("__set__", 0);
3490
3491 /* "pygame_sdl2/rect.pyx":123
3492 * return self.h
3493 * def __set__(self, val):
3494 * self.h = val # <<<<<<<<<<<<<<
3495 *
3496 * property right:
3497 */
3498 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error)
3499 __pyx_v_self->h = __pyx_t_1;
3500
3501 /* "pygame_sdl2/rect.pyx":122
3502 * def __get__(self):
3503 * return self.h
3504 * def __set__(self, val): # <<<<<<<<<<<<<<
3505 * self.h = val
3506 *
3507 */
3508
3509 /* function exit code */
3510 __pyx_r = 0;
3511 goto __pyx_L0;
3512 __pyx_L1_error:;
3513 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.height.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3514 __pyx_r = -1;
3515 __pyx_L0:;
3516 __Pyx_RefNannyFinishContext();
3517 return __pyx_r;
3518 }
3519
3520 /* "pygame_sdl2/rect.pyx":126
3521 *
3522 * property right:
3523 * def __get__(self): # <<<<<<<<<<<<<<
3524 * return self.x + self.width
3525 * def __set__(self, val):
3526 */
3527
3528 /* Python wrapper */
3529 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject * __pyx_v_self)3530 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(PyObject *__pyx_v_self) {
3531 PyObject *__pyx_r = 0;
3532 __Pyx_RefNannyDeclarations
3533 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3534 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
3535
3536 /* function exit code */
3537 __Pyx_RefNannyFinishContext();
3538 return __pyx_r;
3539 }
3540
__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)3541 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_5right___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
3542 PyObject *__pyx_r = NULL;
3543 __Pyx_RefNannyDeclarations
3544 PyObject *__pyx_t_1 = NULL;
3545 PyObject *__pyx_t_2 = NULL;
3546 PyObject *__pyx_t_3 = NULL;
3547 int __pyx_lineno = 0;
3548 const char *__pyx_filename = NULL;
3549 int __pyx_clineno = 0;
3550 __Pyx_RefNannySetupContext("__get__", 0);
3551
3552 /* "pygame_sdl2/rect.pyx":127
3553 * property right:
3554 * def __get__(self):
3555 * return self.x + self.width # <<<<<<<<<<<<<<
3556 * def __set__(self, val):
3557 * self.x += val - self.right
3558 */
3559 __Pyx_XDECREF(__pyx_r);
3560 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
3561 __Pyx_GOTREF(__pyx_t_1);
3562 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_width); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
3563 __Pyx_GOTREF(__pyx_t_2);
3564 __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error)
3565 __Pyx_GOTREF(__pyx_t_3);
3566 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3567 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3568 __pyx_r = __pyx_t_3;
3569 __pyx_t_3 = 0;
3570 goto __pyx_L0;
3571
3572 /* "pygame_sdl2/rect.pyx":126
3573 *
3574 * property right:
3575 * def __get__(self): # <<<<<<<<<<<<<<
3576 * return self.x + self.width
3577 * def __set__(self, val):
3578 */
3579
3580 /* function exit code */
3581 __pyx_L1_error:;
3582 __Pyx_XDECREF(__pyx_t_1);
3583 __Pyx_XDECREF(__pyx_t_2);
3584 __Pyx_XDECREF(__pyx_t_3);
3585 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.right.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3586 __pyx_r = NULL;
3587 __pyx_L0:;
3588 __Pyx_XGIVEREF(__pyx_r);
3589 __Pyx_RefNannyFinishContext();
3590 return __pyx_r;
3591 }
3592
3593 /* "pygame_sdl2/rect.pyx":128
3594 * def __get__(self):
3595 * return self.x + self.width
3596 * def __set__(self, val): # <<<<<<<<<<<<<<
3597 * self.x += val - self.right
3598 *
3599 */
3600
3601 /* Python wrapper */
3602 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)3603 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
3604 int __pyx_r;
3605 __Pyx_RefNannyDeclarations
3606 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3607 __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));
3608
3609 /* function exit code */
3610 __Pyx_RefNannyFinishContext();
3611 return __pyx_r;
3612 }
3613
__pyx_pf_11pygame_sdl2_4rect_4Rect_5right_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)3614 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) {
3615 int __pyx_r;
3616 __Pyx_RefNannyDeclarations
3617 PyObject *__pyx_t_1 = NULL;
3618 PyObject *__pyx_t_2 = NULL;
3619 PyObject *__pyx_t_3 = NULL;
3620 int __pyx_t_4;
3621 int __pyx_lineno = 0;
3622 const char *__pyx_filename = NULL;
3623 int __pyx_clineno = 0;
3624 __Pyx_RefNannySetupContext("__set__", 0);
3625
3626 /* "pygame_sdl2/rect.pyx":129
3627 * return self.x + self.width
3628 * def __set__(self, val):
3629 * self.x += val - self.right # <<<<<<<<<<<<<<
3630 *
3631 * property bottom:
3632 */
3633 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
3634 __Pyx_GOTREF(__pyx_t_1);
3635 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
3636 __Pyx_GOTREF(__pyx_t_2);
3637 __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
3638 __Pyx_GOTREF(__pyx_t_3);
3639 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3640 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
3641 __Pyx_GOTREF(__pyx_t_2);
3642 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3643 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3644 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L1_error)
3645 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3646 __pyx_v_self->x = __pyx_t_4;
3647
3648 /* "pygame_sdl2/rect.pyx":128
3649 * def __get__(self):
3650 * return self.x + self.width
3651 * def __set__(self, val): # <<<<<<<<<<<<<<
3652 * self.x += val - self.right
3653 *
3654 */
3655
3656 /* function exit code */
3657 __pyx_r = 0;
3658 goto __pyx_L0;
3659 __pyx_L1_error:;
3660 __Pyx_XDECREF(__pyx_t_1);
3661 __Pyx_XDECREF(__pyx_t_2);
3662 __Pyx_XDECREF(__pyx_t_3);
3663 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.right.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3664 __pyx_r = -1;
3665 __pyx_L0:;
3666 __Pyx_RefNannyFinishContext();
3667 return __pyx_r;
3668 }
3669
3670 /* "pygame_sdl2/rect.pyx":132
3671 *
3672 * property bottom:
3673 * def __get__(self): # <<<<<<<<<<<<<<
3674 * return self.y + self.height
3675 * def __set__(self, val):
3676 */
3677
3678 /* Python wrapper */
3679 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject * __pyx_v_self)3680 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(PyObject *__pyx_v_self) {
3681 PyObject *__pyx_r = 0;
3682 __Pyx_RefNannyDeclarations
3683 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3684 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
3685
3686 /* function exit code */
3687 __Pyx_RefNannyFinishContext();
3688 return __pyx_r;
3689 }
3690
__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)3691 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
3692 PyObject *__pyx_r = NULL;
3693 __Pyx_RefNannyDeclarations
3694 PyObject *__pyx_t_1 = NULL;
3695 PyObject *__pyx_t_2 = NULL;
3696 PyObject *__pyx_t_3 = NULL;
3697 int __pyx_lineno = 0;
3698 const char *__pyx_filename = NULL;
3699 int __pyx_clineno = 0;
3700 __Pyx_RefNannySetupContext("__get__", 0);
3701
3702 /* "pygame_sdl2/rect.pyx":133
3703 * property bottom:
3704 * def __get__(self):
3705 * return self.y + self.height # <<<<<<<<<<<<<<
3706 * def __set__(self, val):
3707 * self.y += val - self.bottom
3708 */
3709 __Pyx_XDECREF(__pyx_r);
3710 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
3711 __Pyx_GOTREF(__pyx_t_1);
3712 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_height); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
3713 __Pyx_GOTREF(__pyx_t_2);
3714 __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
3715 __Pyx_GOTREF(__pyx_t_3);
3716 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3717 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3718 __pyx_r = __pyx_t_3;
3719 __pyx_t_3 = 0;
3720 goto __pyx_L0;
3721
3722 /* "pygame_sdl2/rect.pyx":132
3723 *
3724 * property bottom:
3725 * def __get__(self): # <<<<<<<<<<<<<<
3726 * return self.y + self.height
3727 * def __set__(self, val):
3728 */
3729
3730 /* function exit code */
3731 __pyx_L1_error:;
3732 __Pyx_XDECREF(__pyx_t_1);
3733 __Pyx_XDECREF(__pyx_t_2);
3734 __Pyx_XDECREF(__pyx_t_3);
3735 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3736 __pyx_r = NULL;
3737 __pyx_L0:;
3738 __Pyx_XGIVEREF(__pyx_r);
3739 __Pyx_RefNannyFinishContext();
3740 return __pyx_r;
3741 }
3742
3743 /* "pygame_sdl2/rect.pyx":134
3744 * def __get__(self):
3745 * return self.y + self.height
3746 * def __set__(self, val): # <<<<<<<<<<<<<<
3747 * self.y += val - self.bottom
3748 *
3749 */
3750
3751 /* Python wrapper */
3752 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)3753 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
3754 int __pyx_r;
3755 __Pyx_RefNannyDeclarations
3756 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3757 __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));
3758
3759 /* function exit code */
3760 __Pyx_RefNannyFinishContext();
3761 return __pyx_r;
3762 }
3763
__pyx_pf_11pygame_sdl2_4rect_4Rect_6bottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)3764 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) {
3765 int __pyx_r;
3766 __Pyx_RefNannyDeclarations
3767 PyObject *__pyx_t_1 = NULL;
3768 PyObject *__pyx_t_2 = NULL;
3769 PyObject *__pyx_t_3 = NULL;
3770 int __pyx_t_4;
3771 int __pyx_lineno = 0;
3772 const char *__pyx_filename = NULL;
3773 int __pyx_clineno = 0;
3774 __Pyx_RefNannySetupContext("__set__", 0);
3775
3776 /* "pygame_sdl2/rect.pyx":135
3777 * return self.y + self.height
3778 * def __set__(self, val):
3779 * self.y += val - self.bottom # <<<<<<<<<<<<<<
3780 *
3781 * property size:
3782 */
3783 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
3784 __Pyx_GOTREF(__pyx_t_1);
3785 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
3786 __Pyx_GOTREF(__pyx_t_2);
3787 __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
3788 __Pyx_GOTREF(__pyx_t_3);
3789 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3790 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
3791 __Pyx_GOTREF(__pyx_t_2);
3792 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3793 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3794 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
3795 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3796 __pyx_v_self->y = __pyx_t_4;
3797
3798 /* "pygame_sdl2/rect.pyx":134
3799 * def __get__(self):
3800 * return self.y + self.height
3801 * def __set__(self, val): # <<<<<<<<<<<<<<
3802 * self.y += val - self.bottom
3803 *
3804 */
3805
3806 /* function exit code */
3807 __pyx_r = 0;
3808 goto __pyx_L0;
3809 __pyx_L1_error:;
3810 __Pyx_XDECREF(__pyx_t_1);
3811 __Pyx_XDECREF(__pyx_t_2);
3812 __Pyx_XDECREF(__pyx_t_3);
3813 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3814 __pyx_r = -1;
3815 __pyx_L0:;
3816 __Pyx_RefNannyFinishContext();
3817 return __pyx_r;
3818 }
3819
3820 /* "pygame_sdl2/rect.pyx":138
3821 *
3822 * property size:
3823 * def __get__(self): # <<<<<<<<<<<<<<
3824 * return (self.w, self.h)
3825 * def __set__(self, val):
3826 */
3827
3828 /* Python wrapper */
3829 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject * __pyx_v_self)3830 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(PyObject *__pyx_v_self) {
3831 PyObject *__pyx_r = 0;
3832 __Pyx_RefNannyDeclarations
3833 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3834 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
3835
3836 /* function exit code */
3837 __Pyx_RefNannyFinishContext();
3838 return __pyx_r;
3839 }
3840
__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)3841 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_4size___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
3842 PyObject *__pyx_r = NULL;
3843 __Pyx_RefNannyDeclarations
3844 PyObject *__pyx_t_1 = NULL;
3845 PyObject *__pyx_t_2 = NULL;
3846 PyObject *__pyx_t_3 = NULL;
3847 int __pyx_lineno = 0;
3848 const char *__pyx_filename = NULL;
3849 int __pyx_clineno = 0;
3850 __Pyx_RefNannySetupContext("__get__", 0);
3851
3852 /* "pygame_sdl2/rect.pyx":139
3853 * property size:
3854 * def __get__(self):
3855 * return (self.w, self.h) # <<<<<<<<<<<<<<
3856 * def __set__(self, val):
3857 * self.w, self.h = val
3858 */
3859 __Pyx_XDECREF(__pyx_r);
3860 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
3861 __Pyx_GOTREF(__pyx_t_1);
3862 __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
3863 __Pyx_GOTREF(__pyx_t_2);
3864 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error)
3865 __Pyx_GOTREF(__pyx_t_3);
3866 __Pyx_GIVEREF(__pyx_t_1);
3867 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
3868 __Pyx_GIVEREF(__pyx_t_2);
3869 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
3870 __pyx_t_1 = 0;
3871 __pyx_t_2 = 0;
3872 __pyx_r = __pyx_t_3;
3873 __pyx_t_3 = 0;
3874 goto __pyx_L0;
3875
3876 /* "pygame_sdl2/rect.pyx":138
3877 *
3878 * property size:
3879 * def __get__(self): # <<<<<<<<<<<<<<
3880 * return (self.w, self.h)
3881 * def __set__(self, val):
3882 */
3883
3884 /* function exit code */
3885 __pyx_L1_error:;
3886 __Pyx_XDECREF(__pyx_t_1);
3887 __Pyx_XDECREF(__pyx_t_2);
3888 __Pyx_XDECREF(__pyx_t_3);
3889 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3890 __pyx_r = NULL;
3891 __pyx_L0:;
3892 __Pyx_XGIVEREF(__pyx_r);
3893 __Pyx_RefNannyFinishContext();
3894 return __pyx_r;
3895 }
3896
3897 /* "pygame_sdl2/rect.pyx":140
3898 * def __get__(self):
3899 * return (self.w, self.h)
3900 * def __set__(self, val): # <<<<<<<<<<<<<<
3901 * self.w, self.h = val
3902 *
3903 */
3904
3905 /* Python wrapper */
3906 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)3907 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
3908 int __pyx_r;
3909 __Pyx_RefNannyDeclarations
3910 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3911 __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));
3912
3913 /* function exit code */
3914 __Pyx_RefNannyFinishContext();
3915 return __pyx_r;
3916 }
3917
__pyx_pf_11pygame_sdl2_4rect_4Rect_4size_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)3918 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) {
3919 int __pyx_r;
3920 __Pyx_RefNannyDeclarations
3921 PyObject *__pyx_t_1 = NULL;
3922 PyObject *__pyx_t_2 = NULL;
3923 PyObject *__pyx_t_3 = NULL;
3924 PyObject *(*__pyx_t_4)(PyObject *);
3925 int __pyx_t_5;
3926 int __pyx_t_6;
3927 int __pyx_lineno = 0;
3928 const char *__pyx_filename = NULL;
3929 int __pyx_clineno = 0;
3930 __Pyx_RefNannySetupContext("__set__", 0);
3931
3932 /* "pygame_sdl2/rect.pyx":141
3933 * return (self.w, self.h)
3934 * def __set__(self, val):
3935 * self.w, self.h = val # <<<<<<<<<<<<<<
3936 *
3937 * property topleft:
3938 */
3939 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
3940 PyObject* sequence = __pyx_v_val;
3941 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
3942 if (unlikely(size != 2)) {
3943 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
3944 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
3945 __PYX_ERR(0, 141, __pyx_L1_error)
3946 }
3947 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3948 if (likely(PyTuple_CheckExact(sequence))) {
3949 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
3950 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
3951 } else {
3952 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
3953 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
3954 }
3955 __Pyx_INCREF(__pyx_t_1);
3956 __Pyx_INCREF(__pyx_t_2);
3957 #else
3958 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
3959 __Pyx_GOTREF(__pyx_t_1);
3960 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error)
3961 __Pyx_GOTREF(__pyx_t_2);
3962 #endif
3963 } else {
3964 Py_ssize_t index = -1;
3965 __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 141, __pyx_L1_error)
3966 __Pyx_GOTREF(__pyx_t_3);
3967 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
3968 index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
3969 __Pyx_GOTREF(__pyx_t_1);
3970 index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
3971 __Pyx_GOTREF(__pyx_t_2);
3972 if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 141, __pyx_L1_error)
3973 __pyx_t_4 = NULL;
3974 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3975 goto __pyx_L4_unpacking_done;
3976 __pyx_L3_unpacking_failed:;
3977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3978 __pyx_t_4 = NULL;
3979 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
3980 __PYX_ERR(0, 141, __pyx_L1_error)
3981 __pyx_L4_unpacking_done:;
3982 }
3983 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
3984 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3985 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 141, __pyx_L1_error)
3986 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3987 __pyx_v_self->w = __pyx_t_5;
3988 __pyx_v_self->h = __pyx_t_6;
3989
3990 /* "pygame_sdl2/rect.pyx":140
3991 * def __get__(self):
3992 * return (self.w, self.h)
3993 * def __set__(self, val): # <<<<<<<<<<<<<<
3994 * self.w, self.h = val
3995 *
3996 */
3997
3998 /* function exit code */
3999 __pyx_r = 0;
4000 goto __pyx_L0;
4001 __pyx_L1_error:;
4002 __Pyx_XDECREF(__pyx_t_1);
4003 __Pyx_XDECREF(__pyx_t_2);
4004 __Pyx_XDECREF(__pyx_t_3);
4005 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.size.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4006 __pyx_r = -1;
4007 __pyx_L0:;
4008 __Pyx_RefNannyFinishContext();
4009 return __pyx_r;
4010 }
4011
4012 /* "pygame_sdl2/rect.pyx":144
4013 *
4014 * property topleft:
4015 * def __get__(self): # <<<<<<<<<<<<<<
4016 * return (self.left, self.top)
4017 * def __set__(self, val):
4018 */
4019
4020 /* Python wrapper */
4021 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject * __pyx_v_self)4022 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(PyObject *__pyx_v_self) {
4023 PyObject *__pyx_r = 0;
4024 __Pyx_RefNannyDeclarations
4025 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4026 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
4027
4028 /* function exit code */
4029 __Pyx_RefNannyFinishContext();
4030 return __pyx_r;
4031 }
4032
__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)4033 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
4034 PyObject *__pyx_r = NULL;
4035 __Pyx_RefNannyDeclarations
4036 PyObject *__pyx_t_1 = NULL;
4037 PyObject *__pyx_t_2 = NULL;
4038 PyObject *__pyx_t_3 = NULL;
4039 int __pyx_lineno = 0;
4040 const char *__pyx_filename = NULL;
4041 int __pyx_clineno = 0;
4042 __Pyx_RefNannySetupContext("__get__", 0);
4043
4044 /* "pygame_sdl2/rect.pyx":145
4045 * property topleft:
4046 * def __get__(self):
4047 * return (self.left, self.top) # <<<<<<<<<<<<<<
4048 * def __set__(self, val):
4049 * self.left, self.top = val
4050 */
4051 __Pyx_XDECREF(__pyx_r);
4052 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
4053 __Pyx_GOTREF(__pyx_t_1);
4054 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
4055 __Pyx_GOTREF(__pyx_t_2);
4056 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error)
4057 __Pyx_GOTREF(__pyx_t_3);
4058 __Pyx_GIVEREF(__pyx_t_1);
4059 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4060 __Pyx_GIVEREF(__pyx_t_2);
4061 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4062 __pyx_t_1 = 0;
4063 __pyx_t_2 = 0;
4064 __pyx_r = __pyx_t_3;
4065 __pyx_t_3 = 0;
4066 goto __pyx_L0;
4067
4068 /* "pygame_sdl2/rect.pyx":144
4069 *
4070 * property topleft:
4071 * def __get__(self): # <<<<<<<<<<<<<<
4072 * return (self.left, self.top)
4073 * def __set__(self, val):
4074 */
4075
4076 /* function exit code */
4077 __pyx_L1_error:;
4078 __Pyx_XDECREF(__pyx_t_1);
4079 __Pyx_XDECREF(__pyx_t_2);
4080 __Pyx_XDECREF(__pyx_t_3);
4081 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4082 __pyx_r = NULL;
4083 __pyx_L0:;
4084 __Pyx_XGIVEREF(__pyx_r);
4085 __Pyx_RefNannyFinishContext();
4086 return __pyx_r;
4087 }
4088
4089 /* "pygame_sdl2/rect.pyx":146
4090 * def __get__(self):
4091 * return (self.left, self.top)
4092 * def __set__(self, val): # <<<<<<<<<<<<<<
4093 * self.left, self.top = val
4094 *
4095 */
4096
4097 /* Python wrapper */
4098 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)4099 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
4100 int __pyx_r;
4101 __Pyx_RefNannyDeclarations
4102 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4103 __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));
4104
4105 /* function exit code */
4106 __Pyx_RefNannyFinishContext();
4107 return __pyx_r;
4108 }
4109
__pyx_pf_11pygame_sdl2_4rect_4Rect_7topleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)4110 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) {
4111 int __pyx_r;
4112 __Pyx_RefNannyDeclarations
4113 PyObject *__pyx_t_1 = NULL;
4114 PyObject *__pyx_t_2 = NULL;
4115 PyObject *__pyx_t_3 = NULL;
4116 PyObject *(*__pyx_t_4)(PyObject *);
4117 int __pyx_lineno = 0;
4118 const char *__pyx_filename = NULL;
4119 int __pyx_clineno = 0;
4120 __Pyx_RefNannySetupContext("__set__", 0);
4121
4122 /* "pygame_sdl2/rect.pyx":147
4123 * return (self.left, self.top)
4124 * def __set__(self, val):
4125 * self.left, self.top = val # <<<<<<<<<<<<<<
4126 *
4127 * property topright:
4128 */
4129 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
4130 PyObject* sequence = __pyx_v_val;
4131 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
4132 if (unlikely(size != 2)) {
4133 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
4134 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4135 __PYX_ERR(0, 147, __pyx_L1_error)
4136 }
4137 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4138 if (likely(PyTuple_CheckExact(sequence))) {
4139 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
4140 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
4141 } else {
4142 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
4143 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
4144 }
4145 __Pyx_INCREF(__pyx_t_1);
4146 __Pyx_INCREF(__pyx_t_2);
4147 #else
4148 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
4149 __Pyx_GOTREF(__pyx_t_1);
4150 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
4151 __Pyx_GOTREF(__pyx_t_2);
4152 #endif
4153 } else {
4154 Py_ssize_t index = -1;
4155 __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
4156 __Pyx_GOTREF(__pyx_t_3);
4157 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
4158 index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
4159 __Pyx_GOTREF(__pyx_t_1);
4160 index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
4161 __Pyx_GOTREF(__pyx_t_2);
4162 if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
4163 __pyx_t_4 = NULL;
4164 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4165 goto __pyx_L4_unpacking_done;
4166 __pyx_L3_unpacking_failed:;
4167 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4168 __pyx_t_4 = NULL;
4169 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4170 __PYX_ERR(0, 147, __pyx_L1_error)
4171 __pyx_L4_unpacking_done:;
4172 }
4173 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
4174 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4175 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
4176 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4177
4178 /* "pygame_sdl2/rect.pyx":146
4179 * def __get__(self):
4180 * return (self.left, self.top)
4181 * def __set__(self, val): # <<<<<<<<<<<<<<
4182 * self.left, self.top = val
4183 *
4184 */
4185
4186 /* function exit code */
4187 __pyx_r = 0;
4188 goto __pyx_L0;
4189 __pyx_L1_error:;
4190 __Pyx_XDECREF(__pyx_t_1);
4191 __Pyx_XDECREF(__pyx_t_2);
4192 __Pyx_XDECREF(__pyx_t_3);
4193 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4194 __pyx_r = -1;
4195 __pyx_L0:;
4196 __Pyx_RefNannyFinishContext();
4197 return __pyx_r;
4198 }
4199
4200 /* "pygame_sdl2/rect.pyx":150
4201 *
4202 * property topright:
4203 * def __get__(self): # <<<<<<<<<<<<<<
4204 * return (self.right, self.top)
4205 * def __set__(self, val):
4206 */
4207
4208 /* Python wrapper */
4209 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject * __pyx_v_self)4210 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(PyObject *__pyx_v_self) {
4211 PyObject *__pyx_r = 0;
4212 __Pyx_RefNannyDeclarations
4213 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4214 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
4215
4216 /* function exit code */
4217 __Pyx_RefNannyFinishContext();
4218 return __pyx_r;
4219 }
4220
__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)4221 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
4222 PyObject *__pyx_r = NULL;
4223 __Pyx_RefNannyDeclarations
4224 PyObject *__pyx_t_1 = NULL;
4225 PyObject *__pyx_t_2 = NULL;
4226 PyObject *__pyx_t_3 = NULL;
4227 int __pyx_lineno = 0;
4228 const char *__pyx_filename = NULL;
4229 int __pyx_clineno = 0;
4230 __Pyx_RefNannySetupContext("__get__", 0);
4231
4232 /* "pygame_sdl2/rect.pyx":151
4233 * property topright:
4234 * def __get__(self):
4235 * return (self.right, self.top) # <<<<<<<<<<<<<<
4236 * def __set__(self, val):
4237 * self.right, self.top = val
4238 */
4239 __Pyx_XDECREF(__pyx_r);
4240 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
4241 __Pyx_GOTREF(__pyx_t_1);
4242 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
4243 __Pyx_GOTREF(__pyx_t_2);
4244 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
4245 __Pyx_GOTREF(__pyx_t_3);
4246 __Pyx_GIVEREF(__pyx_t_1);
4247 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4248 __Pyx_GIVEREF(__pyx_t_2);
4249 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4250 __pyx_t_1 = 0;
4251 __pyx_t_2 = 0;
4252 __pyx_r = __pyx_t_3;
4253 __pyx_t_3 = 0;
4254 goto __pyx_L0;
4255
4256 /* "pygame_sdl2/rect.pyx":150
4257 *
4258 * property topright:
4259 * def __get__(self): # <<<<<<<<<<<<<<
4260 * return (self.right, self.top)
4261 * def __set__(self, val):
4262 */
4263
4264 /* function exit code */
4265 __pyx_L1_error:;
4266 __Pyx_XDECREF(__pyx_t_1);
4267 __Pyx_XDECREF(__pyx_t_2);
4268 __Pyx_XDECREF(__pyx_t_3);
4269 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4270 __pyx_r = NULL;
4271 __pyx_L0:;
4272 __Pyx_XGIVEREF(__pyx_r);
4273 __Pyx_RefNannyFinishContext();
4274 return __pyx_r;
4275 }
4276
4277 /* "pygame_sdl2/rect.pyx":152
4278 * def __get__(self):
4279 * return (self.right, self.top)
4280 * def __set__(self, val): # <<<<<<<<<<<<<<
4281 * self.right, self.top = val
4282 *
4283 */
4284
4285 /* Python wrapper */
4286 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)4287 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
4288 int __pyx_r;
4289 __Pyx_RefNannyDeclarations
4290 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4291 __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));
4292
4293 /* function exit code */
4294 __Pyx_RefNannyFinishContext();
4295 return __pyx_r;
4296 }
4297
__pyx_pf_11pygame_sdl2_4rect_4Rect_8topright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)4298 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) {
4299 int __pyx_r;
4300 __Pyx_RefNannyDeclarations
4301 PyObject *__pyx_t_1 = NULL;
4302 PyObject *__pyx_t_2 = NULL;
4303 PyObject *__pyx_t_3 = NULL;
4304 PyObject *(*__pyx_t_4)(PyObject *);
4305 int __pyx_lineno = 0;
4306 const char *__pyx_filename = NULL;
4307 int __pyx_clineno = 0;
4308 __Pyx_RefNannySetupContext("__set__", 0);
4309
4310 /* "pygame_sdl2/rect.pyx":153
4311 * return (self.right, self.top)
4312 * def __set__(self, val):
4313 * self.right, self.top = val # <<<<<<<<<<<<<<
4314 *
4315 * property bottomright:
4316 */
4317 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
4318 PyObject* sequence = __pyx_v_val;
4319 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
4320 if (unlikely(size != 2)) {
4321 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
4322 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4323 __PYX_ERR(0, 153, __pyx_L1_error)
4324 }
4325 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4326 if (likely(PyTuple_CheckExact(sequence))) {
4327 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
4328 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
4329 } else {
4330 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
4331 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
4332 }
4333 __Pyx_INCREF(__pyx_t_1);
4334 __Pyx_INCREF(__pyx_t_2);
4335 #else
4336 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
4337 __Pyx_GOTREF(__pyx_t_1);
4338 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
4339 __Pyx_GOTREF(__pyx_t_2);
4340 #endif
4341 } else {
4342 Py_ssize_t index = -1;
4343 __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
4344 __Pyx_GOTREF(__pyx_t_3);
4345 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
4346 index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
4347 __Pyx_GOTREF(__pyx_t_1);
4348 index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
4349 __Pyx_GOTREF(__pyx_t_2);
4350 if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
4351 __pyx_t_4 = NULL;
4352 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4353 goto __pyx_L4_unpacking_done;
4354 __pyx_L3_unpacking_failed:;
4355 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4356 __pyx_t_4 = NULL;
4357 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4358 __PYX_ERR(0, 153, __pyx_L1_error)
4359 __pyx_L4_unpacking_done:;
4360 }
4361 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
4362 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4363 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
4364 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4365
4366 /* "pygame_sdl2/rect.pyx":152
4367 * def __get__(self):
4368 * return (self.right, self.top)
4369 * def __set__(self, val): # <<<<<<<<<<<<<<
4370 * self.right, self.top = val
4371 *
4372 */
4373
4374 /* function exit code */
4375 __pyx_r = 0;
4376 goto __pyx_L0;
4377 __pyx_L1_error:;
4378 __Pyx_XDECREF(__pyx_t_1);
4379 __Pyx_XDECREF(__pyx_t_2);
4380 __Pyx_XDECREF(__pyx_t_3);
4381 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.topright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4382 __pyx_r = -1;
4383 __pyx_L0:;
4384 __Pyx_RefNannyFinishContext();
4385 return __pyx_r;
4386 }
4387
4388 /* "pygame_sdl2/rect.pyx":156
4389 *
4390 * property bottomright:
4391 * def __get__(self): # <<<<<<<<<<<<<<
4392 * return (self.right, self.bottom)
4393 * def __set__(self, val):
4394 */
4395
4396 /* Python wrapper */
4397 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject * __pyx_v_self)4398 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(PyObject *__pyx_v_self) {
4399 PyObject *__pyx_r = 0;
4400 __Pyx_RefNannyDeclarations
4401 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4402 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
4403
4404 /* function exit code */
4405 __Pyx_RefNannyFinishContext();
4406 return __pyx_r;
4407 }
4408
__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)4409 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
4410 PyObject *__pyx_r = NULL;
4411 __Pyx_RefNannyDeclarations
4412 PyObject *__pyx_t_1 = NULL;
4413 PyObject *__pyx_t_2 = NULL;
4414 PyObject *__pyx_t_3 = NULL;
4415 int __pyx_lineno = 0;
4416 const char *__pyx_filename = NULL;
4417 int __pyx_clineno = 0;
4418 __Pyx_RefNannySetupContext("__get__", 0);
4419
4420 /* "pygame_sdl2/rect.pyx":157
4421 * property bottomright:
4422 * def __get__(self):
4423 * return (self.right, self.bottom) # <<<<<<<<<<<<<<
4424 * def __set__(self, val):
4425 * self.right, self.bottom = val
4426 */
4427 __Pyx_XDECREF(__pyx_r);
4428 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
4429 __Pyx_GOTREF(__pyx_t_1);
4430 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
4431 __Pyx_GOTREF(__pyx_t_2);
4432 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
4433 __Pyx_GOTREF(__pyx_t_3);
4434 __Pyx_GIVEREF(__pyx_t_1);
4435 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4436 __Pyx_GIVEREF(__pyx_t_2);
4437 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4438 __pyx_t_1 = 0;
4439 __pyx_t_2 = 0;
4440 __pyx_r = __pyx_t_3;
4441 __pyx_t_3 = 0;
4442 goto __pyx_L0;
4443
4444 /* "pygame_sdl2/rect.pyx":156
4445 *
4446 * property bottomright:
4447 * def __get__(self): # <<<<<<<<<<<<<<
4448 * return (self.right, self.bottom)
4449 * def __set__(self, val):
4450 */
4451
4452 /* function exit code */
4453 __pyx_L1_error:;
4454 __Pyx_XDECREF(__pyx_t_1);
4455 __Pyx_XDECREF(__pyx_t_2);
4456 __Pyx_XDECREF(__pyx_t_3);
4457 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4458 __pyx_r = NULL;
4459 __pyx_L0:;
4460 __Pyx_XGIVEREF(__pyx_r);
4461 __Pyx_RefNannyFinishContext();
4462 return __pyx_r;
4463 }
4464
4465 /* "pygame_sdl2/rect.pyx":158
4466 * def __get__(self):
4467 * return (self.right, self.bottom)
4468 * def __set__(self, val): # <<<<<<<<<<<<<<
4469 * self.right, self.bottom = val
4470 *
4471 */
4472
4473 /* Python wrapper */
4474 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)4475 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
4476 int __pyx_r;
4477 __Pyx_RefNannyDeclarations
4478 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4479 __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));
4480
4481 /* function exit code */
4482 __Pyx_RefNannyFinishContext();
4483 return __pyx_r;
4484 }
4485
__pyx_pf_11pygame_sdl2_4rect_4Rect_11bottomright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)4486 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) {
4487 int __pyx_r;
4488 __Pyx_RefNannyDeclarations
4489 PyObject *__pyx_t_1 = NULL;
4490 PyObject *__pyx_t_2 = NULL;
4491 PyObject *__pyx_t_3 = NULL;
4492 PyObject *(*__pyx_t_4)(PyObject *);
4493 int __pyx_lineno = 0;
4494 const char *__pyx_filename = NULL;
4495 int __pyx_clineno = 0;
4496 __Pyx_RefNannySetupContext("__set__", 0);
4497
4498 /* "pygame_sdl2/rect.pyx":159
4499 * return (self.right, self.bottom)
4500 * def __set__(self, val):
4501 * self.right, self.bottom = val # <<<<<<<<<<<<<<
4502 *
4503 * property bottomleft:
4504 */
4505 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
4506 PyObject* sequence = __pyx_v_val;
4507 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
4508 if (unlikely(size != 2)) {
4509 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
4510 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4511 __PYX_ERR(0, 159, __pyx_L1_error)
4512 }
4513 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4514 if (likely(PyTuple_CheckExact(sequence))) {
4515 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
4516 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
4517 } else {
4518 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
4519 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
4520 }
4521 __Pyx_INCREF(__pyx_t_1);
4522 __Pyx_INCREF(__pyx_t_2);
4523 #else
4524 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
4525 __Pyx_GOTREF(__pyx_t_1);
4526 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
4527 __Pyx_GOTREF(__pyx_t_2);
4528 #endif
4529 } else {
4530 Py_ssize_t index = -1;
4531 __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
4532 __Pyx_GOTREF(__pyx_t_3);
4533 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
4534 index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
4535 __Pyx_GOTREF(__pyx_t_1);
4536 index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
4537 __Pyx_GOTREF(__pyx_t_2);
4538 if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
4539 __pyx_t_4 = NULL;
4540 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4541 goto __pyx_L4_unpacking_done;
4542 __pyx_L3_unpacking_failed:;
4543 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4544 __pyx_t_4 = NULL;
4545 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4546 __PYX_ERR(0, 159, __pyx_L1_error)
4547 __pyx_L4_unpacking_done:;
4548 }
4549 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
4550 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4551 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
4552 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4553
4554 /* "pygame_sdl2/rect.pyx":158
4555 * def __get__(self):
4556 * return (self.right, self.bottom)
4557 * def __set__(self, val): # <<<<<<<<<<<<<<
4558 * self.right, self.bottom = val
4559 *
4560 */
4561
4562 /* function exit code */
4563 __pyx_r = 0;
4564 goto __pyx_L0;
4565 __pyx_L1_error:;
4566 __Pyx_XDECREF(__pyx_t_1);
4567 __Pyx_XDECREF(__pyx_t_2);
4568 __Pyx_XDECREF(__pyx_t_3);
4569 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4570 __pyx_r = -1;
4571 __pyx_L0:;
4572 __Pyx_RefNannyFinishContext();
4573 return __pyx_r;
4574 }
4575
4576 /* "pygame_sdl2/rect.pyx":162
4577 *
4578 * property bottomleft:
4579 * def __get__(self): # <<<<<<<<<<<<<<
4580 * return (self.left, self.bottom)
4581 * def __set__(self, val):
4582 */
4583
4584 /* Python wrapper */
4585 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject * __pyx_v_self)4586 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(PyObject *__pyx_v_self) {
4587 PyObject *__pyx_r = 0;
4588 __Pyx_RefNannyDeclarations
4589 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4590 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
4591
4592 /* function exit code */
4593 __Pyx_RefNannyFinishContext();
4594 return __pyx_r;
4595 }
4596
__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)4597 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
4598 PyObject *__pyx_r = NULL;
4599 __Pyx_RefNannyDeclarations
4600 PyObject *__pyx_t_1 = NULL;
4601 PyObject *__pyx_t_2 = NULL;
4602 PyObject *__pyx_t_3 = NULL;
4603 int __pyx_lineno = 0;
4604 const char *__pyx_filename = NULL;
4605 int __pyx_clineno = 0;
4606 __Pyx_RefNannySetupContext("__get__", 0);
4607
4608 /* "pygame_sdl2/rect.pyx":163
4609 * property bottomleft:
4610 * def __get__(self):
4611 * return (self.left, self.bottom) # <<<<<<<<<<<<<<
4612 * def __set__(self, val):
4613 * self.left, self.bottom = val
4614 */
4615 __Pyx_XDECREF(__pyx_r);
4616 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
4617 __Pyx_GOTREF(__pyx_t_1);
4618 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 163, __pyx_L1_error)
4619 __Pyx_GOTREF(__pyx_t_2);
4620 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
4621 __Pyx_GOTREF(__pyx_t_3);
4622 __Pyx_GIVEREF(__pyx_t_1);
4623 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
4624 __Pyx_GIVEREF(__pyx_t_2);
4625 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
4626 __pyx_t_1 = 0;
4627 __pyx_t_2 = 0;
4628 __pyx_r = __pyx_t_3;
4629 __pyx_t_3 = 0;
4630 goto __pyx_L0;
4631
4632 /* "pygame_sdl2/rect.pyx":162
4633 *
4634 * property bottomleft:
4635 * def __get__(self): # <<<<<<<<<<<<<<
4636 * return (self.left, self.bottom)
4637 * def __set__(self, val):
4638 */
4639
4640 /* function exit code */
4641 __pyx_L1_error:;
4642 __Pyx_XDECREF(__pyx_t_1);
4643 __Pyx_XDECREF(__pyx_t_2);
4644 __Pyx_XDECREF(__pyx_t_3);
4645 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4646 __pyx_r = NULL;
4647 __pyx_L0:;
4648 __Pyx_XGIVEREF(__pyx_r);
4649 __Pyx_RefNannyFinishContext();
4650 return __pyx_r;
4651 }
4652
4653 /* "pygame_sdl2/rect.pyx":164
4654 * def __get__(self):
4655 * return (self.left, self.bottom)
4656 * def __set__(self, val): # <<<<<<<<<<<<<<
4657 * self.left, self.bottom = val
4658 *
4659 */
4660
4661 /* Python wrapper */
4662 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)4663 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
4664 int __pyx_r;
4665 __Pyx_RefNannyDeclarations
4666 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4667 __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));
4668
4669 /* function exit code */
4670 __Pyx_RefNannyFinishContext();
4671 return __pyx_r;
4672 }
4673
__pyx_pf_11pygame_sdl2_4rect_4Rect_10bottomleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)4674 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) {
4675 int __pyx_r;
4676 __Pyx_RefNannyDeclarations
4677 PyObject *__pyx_t_1 = NULL;
4678 PyObject *__pyx_t_2 = NULL;
4679 PyObject *__pyx_t_3 = NULL;
4680 PyObject *(*__pyx_t_4)(PyObject *);
4681 int __pyx_lineno = 0;
4682 const char *__pyx_filename = NULL;
4683 int __pyx_clineno = 0;
4684 __Pyx_RefNannySetupContext("__set__", 0);
4685
4686 /* "pygame_sdl2/rect.pyx":165
4687 * return (self.left, self.bottom)
4688 * def __set__(self, val):
4689 * self.left, self.bottom = val # <<<<<<<<<<<<<<
4690 *
4691 * property centerx:
4692 */
4693 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
4694 PyObject* sequence = __pyx_v_val;
4695 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
4696 if (unlikely(size != 2)) {
4697 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
4698 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4699 __PYX_ERR(0, 165, __pyx_L1_error)
4700 }
4701 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4702 if (likely(PyTuple_CheckExact(sequence))) {
4703 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
4704 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
4705 } else {
4706 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
4707 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
4708 }
4709 __Pyx_INCREF(__pyx_t_1);
4710 __Pyx_INCREF(__pyx_t_2);
4711 #else
4712 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
4713 __Pyx_GOTREF(__pyx_t_1);
4714 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
4715 __Pyx_GOTREF(__pyx_t_2);
4716 #endif
4717 } else {
4718 Py_ssize_t index = -1;
4719 __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
4720 __Pyx_GOTREF(__pyx_t_3);
4721 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
4722 index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
4723 __Pyx_GOTREF(__pyx_t_1);
4724 index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
4725 __Pyx_GOTREF(__pyx_t_2);
4726 if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
4727 __pyx_t_4 = NULL;
4728 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4729 goto __pyx_L4_unpacking_done;
4730 __pyx_L3_unpacking_failed:;
4731 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4732 __pyx_t_4 = NULL;
4733 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4734 __PYX_ERR(0, 165, __pyx_L1_error)
4735 __pyx_L4_unpacking_done:;
4736 }
4737 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
4738 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4739 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
4740 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4741
4742 /* "pygame_sdl2/rect.pyx":164
4743 * def __get__(self):
4744 * return (self.left, self.bottom)
4745 * def __set__(self, val): # <<<<<<<<<<<<<<
4746 * self.left, self.bottom = val
4747 *
4748 */
4749
4750 /* function exit code */
4751 __pyx_r = 0;
4752 goto __pyx_L0;
4753 __pyx_L1_error:;
4754 __Pyx_XDECREF(__pyx_t_1);
4755 __Pyx_XDECREF(__pyx_t_2);
4756 __Pyx_XDECREF(__pyx_t_3);
4757 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.bottomleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4758 __pyx_r = -1;
4759 __pyx_L0:;
4760 __Pyx_RefNannyFinishContext();
4761 return __pyx_r;
4762 }
4763
4764 /* "pygame_sdl2/rect.pyx":168
4765 *
4766 * property centerx:
4767 * def __get__(self): # <<<<<<<<<<<<<<
4768 * return self.x + (self.w / 2)
4769 * def __set__(self, val):
4770 */
4771
4772 /* Python wrapper */
4773 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject * __pyx_v_self)4774 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(PyObject *__pyx_v_self) {
4775 PyObject *__pyx_r = 0;
4776 __Pyx_RefNannyDeclarations
4777 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4778 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
4779
4780 /* function exit code */
4781 __Pyx_RefNannyFinishContext();
4782 return __pyx_r;
4783 }
4784
__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)4785 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
4786 PyObject *__pyx_r = NULL;
4787 __Pyx_RefNannyDeclarations
4788 PyObject *__pyx_t_1 = NULL;
4789 int __pyx_lineno = 0;
4790 const char *__pyx_filename = NULL;
4791 int __pyx_clineno = 0;
4792 __Pyx_RefNannySetupContext("__get__", 0);
4793
4794 /* "pygame_sdl2/rect.pyx":169
4795 * property centerx:
4796 * def __get__(self):
4797 * return self.x + (self.w / 2) # <<<<<<<<<<<<<<
4798 * def __set__(self, val):
4799 * self.x += val - self.centerx
4800 */
4801 __Pyx_XDECREF(__pyx_r);
4802 __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_ERR(0, 169, __pyx_L1_error)
4803 __Pyx_GOTREF(__pyx_t_1);
4804 __pyx_r = __pyx_t_1;
4805 __pyx_t_1 = 0;
4806 goto __pyx_L0;
4807
4808 /* "pygame_sdl2/rect.pyx":168
4809 *
4810 * property centerx:
4811 * def __get__(self): # <<<<<<<<<<<<<<
4812 * return self.x + (self.w / 2)
4813 * def __set__(self, val):
4814 */
4815
4816 /* function exit code */
4817 __pyx_L1_error:;
4818 __Pyx_XDECREF(__pyx_t_1);
4819 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centerx.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4820 __pyx_r = NULL;
4821 __pyx_L0:;
4822 __Pyx_XGIVEREF(__pyx_r);
4823 __Pyx_RefNannyFinishContext();
4824 return __pyx_r;
4825 }
4826
4827 /* "pygame_sdl2/rect.pyx":170
4828 * def __get__(self):
4829 * return self.x + (self.w / 2)
4830 * def __set__(self, val): # <<<<<<<<<<<<<<
4831 * self.x += val - self.centerx
4832 *
4833 */
4834
4835 /* Python wrapper */
4836 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)4837 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
4838 int __pyx_r;
4839 __Pyx_RefNannyDeclarations
4840 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4841 __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));
4842
4843 /* function exit code */
4844 __Pyx_RefNannyFinishContext();
4845 return __pyx_r;
4846 }
4847
__pyx_pf_11pygame_sdl2_4rect_4Rect_7centerx_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)4848 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) {
4849 int __pyx_r;
4850 __Pyx_RefNannyDeclarations
4851 PyObject *__pyx_t_1 = NULL;
4852 PyObject *__pyx_t_2 = NULL;
4853 PyObject *__pyx_t_3 = NULL;
4854 int __pyx_t_4;
4855 int __pyx_lineno = 0;
4856 const char *__pyx_filename = NULL;
4857 int __pyx_clineno = 0;
4858 __Pyx_RefNannySetupContext("__set__", 0);
4859
4860 /* "pygame_sdl2/rect.pyx":171
4861 * return self.x + (self.w / 2)
4862 * def __set__(self, val):
4863 * self.x += val - self.centerx # <<<<<<<<<<<<<<
4864 *
4865 * property centery:
4866 */
4867 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
4868 __Pyx_GOTREF(__pyx_t_1);
4869 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
4870 __Pyx_GOTREF(__pyx_t_2);
4871 __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
4872 __Pyx_GOTREF(__pyx_t_3);
4873 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4874 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
4875 __Pyx_GOTREF(__pyx_t_2);
4876 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4877 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4878 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 171, __pyx_L1_error)
4879 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4880 __pyx_v_self->x = __pyx_t_4;
4881
4882 /* "pygame_sdl2/rect.pyx":170
4883 * def __get__(self):
4884 * return self.x + (self.w / 2)
4885 * def __set__(self, val): # <<<<<<<<<<<<<<
4886 * self.x += val - self.centerx
4887 *
4888 */
4889
4890 /* function exit code */
4891 __pyx_r = 0;
4892 goto __pyx_L0;
4893 __pyx_L1_error:;
4894 __Pyx_XDECREF(__pyx_t_1);
4895 __Pyx_XDECREF(__pyx_t_2);
4896 __Pyx_XDECREF(__pyx_t_3);
4897 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centerx.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4898 __pyx_r = -1;
4899 __pyx_L0:;
4900 __Pyx_RefNannyFinishContext();
4901 return __pyx_r;
4902 }
4903
4904 /* "pygame_sdl2/rect.pyx":174
4905 *
4906 * property centery:
4907 * def __get__(self): # <<<<<<<<<<<<<<
4908 * return self.y + (self.h / 2)
4909 * def __set__(self, val):
4910 */
4911
4912 /* Python wrapper */
4913 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject * __pyx_v_self)4914 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(PyObject *__pyx_v_self) {
4915 PyObject *__pyx_r = 0;
4916 __Pyx_RefNannyDeclarations
4917 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4918 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
4919
4920 /* function exit code */
4921 __Pyx_RefNannyFinishContext();
4922 return __pyx_r;
4923 }
4924
__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)4925 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
4926 PyObject *__pyx_r = NULL;
4927 __Pyx_RefNannyDeclarations
4928 PyObject *__pyx_t_1 = NULL;
4929 int __pyx_lineno = 0;
4930 const char *__pyx_filename = NULL;
4931 int __pyx_clineno = 0;
4932 __Pyx_RefNannySetupContext("__get__", 0);
4933
4934 /* "pygame_sdl2/rect.pyx":175
4935 * property centery:
4936 * def __get__(self):
4937 * return self.y + (self.h / 2) # <<<<<<<<<<<<<<
4938 * def __set__(self, val):
4939 * self.y += val - self.centery
4940 */
4941 __Pyx_XDECREF(__pyx_r);
4942 __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_ERR(0, 175, __pyx_L1_error)
4943 __Pyx_GOTREF(__pyx_t_1);
4944 __pyx_r = __pyx_t_1;
4945 __pyx_t_1 = 0;
4946 goto __pyx_L0;
4947
4948 /* "pygame_sdl2/rect.pyx":174
4949 *
4950 * property centery:
4951 * def __get__(self): # <<<<<<<<<<<<<<
4952 * return self.y + (self.h / 2)
4953 * def __set__(self, val):
4954 */
4955
4956 /* function exit code */
4957 __pyx_L1_error:;
4958 __Pyx_XDECREF(__pyx_t_1);
4959 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centery.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4960 __pyx_r = NULL;
4961 __pyx_L0:;
4962 __Pyx_XGIVEREF(__pyx_r);
4963 __Pyx_RefNannyFinishContext();
4964 return __pyx_r;
4965 }
4966
4967 /* "pygame_sdl2/rect.pyx":176
4968 * def __get__(self):
4969 * return self.y + (self.h / 2)
4970 * def __set__(self, val): # <<<<<<<<<<<<<<
4971 * self.y += val - self.centery
4972 *
4973 */
4974
4975 /* Python wrapper */
4976 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)4977 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
4978 int __pyx_r;
4979 __Pyx_RefNannyDeclarations
4980 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4981 __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));
4982
4983 /* function exit code */
4984 __Pyx_RefNannyFinishContext();
4985 return __pyx_r;
4986 }
4987
__pyx_pf_11pygame_sdl2_4rect_4Rect_7centery_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)4988 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) {
4989 int __pyx_r;
4990 __Pyx_RefNannyDeclarations
4991 PyObject *__pyx_t_1 = NULL;
4992 PyObject *__pyx_t_2 = NULL;
4993 PyObject *__pyx_t_3 = NULL;
4994 int __pyx_t_4;
4995 int __pyx_lineno = 0;
4996 const char *__pyx_filename = NULL;
4997 int __pyx_clineno = 0;
4998 __Pyx_RefNannySetupContext("__set__", 0);
4999
5000 /* "pygame_sdl2/rect.pyx":177
5001 * return self.y + (self.h / 2)
5002 * def __set__(self, val):
5003 * self.y += val - self.centery # <<<<<<<<<<<<<<
5004 *
5005 * property center:
5006 */
5007 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
5008 __Pyx_GOTREF(__pyx_t_1);
5009 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
5010 __Pyx_GOTREF(__pyx_t_2);
5011 __pyx_t_3 = PyNumber_Subtract(__pyx_v_val, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
5012 __Pyx_GOTREF(__pyx_t_3);
5013 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5014 __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
5015 __Pyx_GOTREF(__pyx_t_2);
5016 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5017 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5018 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error)
5019 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5020 __pyx_v_self->y = __pyx_t_4;
5021
5022 /* "pygame_sdl2/rect.pyx":176
5023 * def __get__(self):
5024 * return self.y + (self.h / 2)
5025 * def __set__(self, val): # <<<<<<<<<<<<<<
5026 * self.y += val - self.centery
5027 *
5028 */
5029
5030 /* function exit code */
5031 __pyx_r = 0;
5032 goto __pyx_L0;
5033 __pyx_L1_error:;
5034 __Pyx_XDECREF(__pyx_t_1);
5035 __Pyx_XDECREF(__pyx_t_2);
5036 __Pyx_XDECREF(__pyx_t_3);
5037 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.centery.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5038 __pyx_r = -1;
5039 __pyx_L0:;
5040 __Pyx_RefNannyFinishContext();
5041 return __pyx_r;
5042 }
5043
5044 /* "pygame_sdl2/rect.pyx":180
5045 *
5046 * property center:
5047 * def __get__(self): # <<<<<<<<<<<<<<
5048 * return (self.centerx, self.centery)
5049 * def __set__(self, val):
5050 */
5051
5052 /* Python wrapper */
5053 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject * __pyx_v_self)5054 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(PyObject *__pyx_v_self) {
5055 PyObject *__pyx_r = 0;
5056 __Pyx_RefNannyDeclarations
5057 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5058 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
5059
5060 /* function exit code */
5061 __Pyx_RefNannyFinishContext();
5062 return __pyx_r;
5063 }
5064
__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)5065 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6center___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
5066 PyObject *__pyx_r = NULL;
5067 __Pyx_RefNannyDeclarations
5068 PyObject *__pyx_t_1 = NULL;
5069 PyObject *__pyx_t_2 = NULL;
5070 PyObject *__pyx_t_3 = NULL;
5071 int __pyx_lineno = 0;
5072 const char *__pyx_filename = NULL;
5073 int __pyx_clineno = 0;
5074 __Pyx_RefNannySetupContext("__get__", 0);
5075
5076 /* "pygame_sdl2/rect.pyx":181
5077 * property center:
5078 * def __get__(self):
5079 * return (self.centerx, self.centery) # <<<<<<<<<<<<<<
5080 * def __set__(self, val):
5081 * self.centerx, self.centery = val
5082 */
5083 __Pyx_XDECREF(__pyx_r);
5084 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
5085 __Pyx_GOTREF(__pyx_t_1);
5086 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
5087 __Pyx_GOTREF(__pyx_t_2);
5088 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
5089 __Pyx_GOTREF(__pyx_t_3);
5090 __Pyx_GIVEREF(__pyx_t_1);
5091 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
5092 __Pyx_GIVEREF(__pyx_t_2);
5093 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
5094 __pyx_t_1 = 0;
5095 __pyx_t_2 = 0;
5096 __pyx_r = __pyx_t_3;
5097 __pyx_t_3 = 0;
5098 goto __pyx_L0;
5099
5100 /* "pygame_sdl2/rect.pyx":180
5101 *
5102 * property center:
5103 * def __get__(self): # <<<<<<<<<<<<<<
5104 * return (self.centerx, self.centery)
5105 * def __set__(self, val):
5106 */
5107
5108 /* function exit code */
5109 __pyx_L1_error:;
5110 __Pyx_XDECREF(__pyx_t_1);
5111 __Pyx_XDECREF(__pyx_t_2);
5112 __Pyx_XDECREF(__pyx_t_3);
5113 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.center.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5114 __pyx_r = NULL;
5115 __pyx_L0:;
5116 __Pyx_XGIVEREF(__pyx_r);
5117 __Pyx_RefNannyFinishContext();
5118 return __pyx_r;
5119 }
5120
5121 /* "pygame_sdl2/rect.pyx":182
5122 * def __get__(self):
5123 * return (self.centerx, self.centery)
5124 * def __set__(self, val): # <<<<<<<<<<<<<<
5125 * self.centerx, self.centery = val
5126 *
5127 */
5128
5129 /* Python wrapper */
5130 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)5131 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
5132 int __pyx_r;
5133 __Pyx_RefNannyDeclarations
5134 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5135 __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));
5136
5137 /* function exit code */
5138 __Pyx_RefNannyFinishContext();
5139 return __pyx_r;
5140 }
5141
__pyx_pf_11pygame_sdl2_4rect_4Rect_6center_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)5142 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) {
5143 int __pyx_r;
5144 __Pyx_RefNannyDeclarations
5145 PyObject *__pyx_t_1 = NULL;
5146 PyObject *__pyx_t_2 = NULL;
5147 PyObject *__pyx_t_3 = NULL;
5148 PyObject *(*__pyx_t_4)(PyObject *);
5149 int __pyx_lineno = 0;
5150 const char *__pyx_filename = NULL;
5151 int __pyx_clineno = 0;
5152 __Pyx_RefNannySetupContext("__set__", 0);
5153
5154 /* "pygame_sdl2/rect.pyx":183
5155 * return (self.centerx, self.centery)
5156 * def __set__(self, val):
5157 * self.centerx, self.centery = val # <<<<<<<<<<<<<<
5158 *
5159 * property midtop:
5160 */
5161 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
5162 PyObject* sequence = __pyx_v_val;
5163 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5164 if (unlikely(size != 2)) {
5165 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5166 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5167 __PYX_ERR(0, 183, __pyx_L1_error)
5168 }
5169 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5170 if (likely(PyTuple_CheckExact(sequence))) {
5171 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
5172 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
5173 } else {
5174 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
5175 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
5176 }
5177 __Pyx_INCREF(__pyx_t_1);
5178 __Pyx_INCREF(__pyx_t_2);
5179 #else
5180 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error)
5181 __Pyx_GOTREF(__pyx_t_1);
5182 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error)
5183 __Pyx_GOTREF(__pyx_t_2);
5184 #endif
5185 } else {
5186 Py_ssize_t index = -1;
5187 __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
5188 __Pyx_GOTREF(__pyx_t_3);
5189 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
5190 index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
5191 __Pyx_GOTREF(__pyx_t_1);
5192 index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
5193 __Pyx_GOTREF(__pyx_t_2);
5194 if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
5195 __pyx_t_4 = NULL;
5196 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5197 goto __pyx_L4_unpacking_done;
5198 __pyx_L3_unpacking_failed:;
5199 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5200 __pyx_t_4 = NULL;
5201 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5202 __PYX_ERR(0, 183, __pyx_L1_error)
5203 __pyx_L4_unpacking_done:;
5204 }
5205 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
5206 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5207 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) __PYX_ERR(0, 183, __pyx_L1_error)
5208 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5209
5210 /* "pygame_sdl2/rect.pyx":182
5211 * def __get__(self):
5212 * return (self.centerx, self.centery)
5213 * def __set__(self, val): # <<<<<<<<<<<<<<
5214 * self.centerx, self.centery = val
5215 *
5216 */
5217
5218 /* function exit code */
5219 __pyx_r = 0;
5220 goto __pyx_L0;
5221 __pyx_L1_error:;
5222 __Pyx_XDECREF(__pyx_t_1);
5223 __Pyx_XDECREF(__pyx_t_2);
5224 __Pyx_XDECREF(__pyx_t_3);
5225 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.center.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5226 __pyx_r = -1;
5227 __pyx_L0:;
5228 __Pyx_RefNannyFinishContext();
5229 return __pyx_r;
5230 }
5231
5232 /* "pygame_sdl2/rect.pyx":186
5233 *
5234 * property midtop:
5235 * def __get__(self): # <<<<<<<<<<<<<<
5236 * return (self.centerx, self.top)
5237 * def __set__(self, val):
5238 */
5239
5240 /* Python wrapper */
5241 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject * __pyx_v_self)5242 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(PyObject *__pyx_v_self) {
5243 PyObject *__pyx_r = 0;
5244 __Pyx_RefNannyDeclarations
5245 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5246 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
5247
5248 /* function exit code */
5249 __Pyx_RefNannyFinishContext();
5250 return __pyx_r;
5251 }
5252
__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)5253 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
5254 PyObject *__pyx_r = NULL;
5255 __Pyx_RefNannyDeclarations
5256 PyObject *__pyx_t_1 = NULL;
5257 PyObject *__pyx_t_2 = NULL;
5258 PyObject *__pyx_t_3 = NULL;
5259 int __pyx_lineno = 0;
5260 const char *__pyx_filename = NULL;
5261 int __pyx_clineno = 0;
5262 __Pyx_RefNannySetupContext("__get__", 0);
5263
5264 /* "pygame_sdl2/rect.pyx":187
5265 * property midtop:
5266 * def __get__(self):
5267 * return (self.centerx, self.top) # <<<<<<<<<<<<<<
5268 * def __set__(self, val):
5269 * self.centerx, self.top = val
5270 */
5271 __Pyx_XDECREF(__pyx_r);
5272 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
5273 __Pyx_GOTREF(__pyx_t_1);
5274 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
5275 __Pyx_GOTREF(__pyx_t_2);
5276 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
5277 __Pyx_GOTREF(__pyx_t_3);
5278 __Pyx_GIVEREF(__pyx_t_1);
5279 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
5280 __Pyx_GIVEREF(__pyx_t_2);
5281 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
5282 __pyx_t_1 = 0;
5283 __pyx_t_2 = 0;
5284 __pyx_r = __pyx_t_3;
5285 __pyx_t_3 = 0;
5286 goto __pyx_L0;
5287
5288 /* "pygame_sdl2/rect.pyx":186
5289 *
5290 * property midtop:
5291 * def __get__(self): # <<<<<<<<<<<<<<
5292 * return (self.centerx, self.top)
5293 * def __set__(self, val):
5294 */
5295
5296 /* function exit code */
5297 __pyx_L1_error:;
5298 __Pyx_XDECREF(__pyx_t_1);
5299 __Pyx_XDECREF(__pyx_t_2);
5300 __Pyx_XDECREF(__pyx_t_3);
5301 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midtop.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5302 __pyx_r = NULL;
5303 __pyx_L0:;
5304 __Pyx_XGIVEREF(__pyx_r);
5305 __Pyx_RefNannyFinishContext();
5306 return __pyx_r;
5307 }
5308
5309 /* "pygame_sdl2/rect.pyx":188
5310 * def __get__(self):
5311 * return (self.centerx, self.top)
5312 * def __set__(self, val): # <<<<<<<<<<<<<<
5313 * self.centerx, self.top = val
5314 *
5315 */
5316
5317 /* Python wrapper */
5318 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)5319 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
5320 int __pyx_r;
5321 __Pyx_RefNannyDeclarations
5322 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5323 __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));
5324
5325 /* function exit code */
5326 __Pyx_RefNannyFinishContext();
5327 return __pyx_r;
5328 }
5329
__pyx_pf_11pygame_sdl2_4rect_4Rect_6midtop_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)5330 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) {
5331 int __pyx_r;
5332 __Pyx_RefNannyDeclarations
5333 PyObject *__pyx_t_1 = NULL;
5334 PyObject *__pyx_t_2 = NULL;
5335 PyObject *__pyx_t_3 = NULL;
5336 PyObject *(*__pyx_t_4)(PyObject *);
5337 int __pyx_lineno = 0;
5338 const char *__pyx_filename = NULL;
5339 int __pyx_clineno = 0;
5340 __Pyx_RefNannySetupContext("__set__", 0);
5341
5342 /* "pygame_sdl2/rect.pyx":189
5343 * return (self.centerx, self.top)
5344 * def __set__(self, val):
5345 * self.centerx, self.top = val # <<<<<<<<<<<<<<
5346 *
5347 * property midleft:
5348 */
5349 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
5350 PyObject* sequence = __pyx_v_val;
5351 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5352 if (unlikely(size != 2)) {
5353 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5354 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5355 __PYX_ERR(0, 189, __pyx_L1_error)
5356 }
5357 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5358 if (likely(PyTuple_CheckExact(sequence))) {
5359 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
5360 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
5361 } else {
5362 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
5363 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
5364 }
5365 __Pyx_INCREF(__pyx_t_1);
5366 __Pyx_INCREF(__pyx_t_2);
5367 #else
5368 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error)
5369 __Pyx_GOTREF(__pyx_t_1);
5370 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
5371 __Pyx_GOTREF(__pyx_t_2);
5372 #endif
5373 } else {
5374 Py_ssize_t index = -1;
5375 __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
5376 __Pyx_GOTREF(__pyx_t_3);
5377 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
5378 index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
5379 __Pyx_GOTREF(__pyx_t_1);
5380 index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
5381 __Pyx_GOTREF(__pyx_t_2);
5382 if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
5383 __pyx_t_4 = NULL;
5384 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5385 goto __pyx_L4_unpacking_done;
5386 __pyx_L3_unpacking_failed:;
5387 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5388 __pyx_t_4 = NULL;
5389 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5390 __PYX_ERR(0, 189, __pyx_L1_error)
5391 __pyx_L4_unpacking_done:;
5392 }
5393 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
5394 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5395 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_2) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
5396 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5397
5398 /* "pygame_sdl2/rect.pyx":188
5399 * def __get__(self):
5400 * return (self.centerx, self.top)
5401 * def __set__(self, val): # <<<<<<<<<<<<<<
5402 * self.centerx, self.top = val
5403 *
5404 */
5405
5406 /* function exit code */
5407 __pyx_r = 0;
5408 goto __pyx_L0;
5409 __pyx_L1_error:;
5410 __Pyx_XDECREF(__pyx_t_1);
5411 __Pyx_XDECREF(__pyx_t_2);
5412 __Pyx_XDECREF(__pyx_t_3);
5413 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midtop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5414 __pyx_r = -1;
5415 __pyx_L0:;
5416 __Pyx_RefNannyFinishContext();
5417 return __pyx_r;
5418 }
5419
5420 /* "pygame_sdl2/rect.pyx":192
5421 *
5422 * property midleft:
5423 * def __get__(self): # <<<<<<<<<<<<<<
5424 * return (self.left, self.centery)
5425 * def __set__(self, val):
5426 */
5427
5428 /* Python wrapper */
5429 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject * __pyx_v_self)5430 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(PyObject *__pyx_v_self) {
5431 PyObject *__pyx_r = 0;
5432 __Pyx_RefNannyDeclarations
5433 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5434 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
5435
5436 /* function exit code */
5437 __Pyx_RefNannyFinishContext();
5438 return __pyx_r;
5439 }
5440
__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)5441 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
5442 PyObject *__pyx_r = NULL;
5443 __Pyx_RefNannyDeclarations
5444 PyObject *__pyx_t_1 = NULL;
5445 PyObject *__pyx_t_2 = NULL;
5446 PyObject *__pyx_t_3 = NULL;
5447 int __pyx_lineno = 0;
5448 const char *__pyx_filename = NULL;
5449 int __pyx_clineno = 0;
5450 __Pyx_RefNannySetupContext("__get__", 0);
5451
5452 /* "pygame_sdl2/rect.pyx":193
5453 * property midleft:
5454 * def __get__(self):
5455 * return (self.left, self.centery) # <<<<<<<<<<<<<<
5456 * def __set__(self, val):
5457 * self.left, self.centery = val
5458 */
5459 __Pyx_XDECREF(__pyx_r);
5460 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
5461 __Pyx_GOTREF(__pyx_t_1);
5462 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
5463 __Pyx_GOTREF(__pyx_t_2);
5464 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
5465 __Pyx_GOTREF(__pyx_t_3);
5466 __Pyx_GIVEREF(__pyx_t_1);
5467 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
5468 __Pyx_GIVEREF(__pyx_t_2);
5469 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
5470 __pyx_t_1 = 0;
5471 __pyx_t_2 = 0;
5472 __pyx_r = __pyx_t_3;
5473 __pyx_t_3 = 0;
5474 goto __pyx_L0;
5475
5476 /* "pygame_sdl2/rect.pyx":192
5477 *
5478 * property midleft:
5479 * def __get__(self): # <<<<<<<<<<<<<<
5480 * return (self.left, self.centery)
5481 * def __set__(self, val):
5482 */
5483
5484 /* function exit code */
5485 __pyx_L1_error:;
5486 __Pyx_XDECREF(__pyx_t_1);
5487 __Pyx_XDECREF(__pyx_t_2);
5488 __Pyx_XDECREF(__pyx_t_3);
5489 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midleft.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5490 __pyx_r = NULL;
5491 __pyx_L0:;
5492 __Pyx_XGIVEREF(__pyx_r);
5493 __Pyx_RefNannyFinishContext();
5494 return __pyx_r;
5495 }
5496
5497 /* "pygame_sdl2/rect.pyx":194
5498 * def __get__(self):
5499 * return (self.left, self.centery)
5500 * def __set__(self, val): # <<<<<<<<<<<<<<
5501 * self.left, self.centery = val
5502 *
5503 */
5504
5505 /* Python wrapper */
5506 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)5507 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
5508 int __pyx_r;
5509 __Pyx_RefNannyDeclarations
5510 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5511 __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));
5512
5513 /* function exit code */
5514 __Pyx_RefNannyFinishContext();
5515 return __pyx_r;
5516 }
5517
__pyx_pf_11pygame_sdl2_4rect_4Rect_7midleft_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)5518 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) {
5519 int __pyx_r;
5520 __Pyx_RefNannyDeclarations
5521 PyObject *__pyx_t_1 = NULL;
5522 PyObject *__pyx_t_2 = NULL;
5523 PyObject *__pyx_t_3 = NULL;
5524 PyObject *(*__pyx_t_4)(PyObject *);
5525 int __pyx_lineno = 0;
5526 const char *__pyx_filename = NULL;
5527 int __pyx_clineno = 0;
5528 __Pyx_RefNannySetupContext("__set__", 0);
5529
5530 /* "pygame_sdl2/rect.pyx":195
5531 * return (self.left, self.centery)
5532 * def __set__(self, val):
5533 * self.left, self.centery = val # <<<<<<<<<<<<<<
5534 *
5535 * property midbottom:
5536 */
5537 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
5538 PyObject* sequence = __pyx_v_val;
5539 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5540 if (unlikely(size != 2)) {
5541 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5542 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5543 __PYX_ERR(0, 195, __pyx_L1_error)
5544 }
5545 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5546 if (likely(PyTuple_CheckExact(sequence))) {
5547 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
5548 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
5549 } else {
5550 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
5551 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
5552 }
5553 __Pyx_INCREF(__pyx_t_1);
5554 __Pyx_INCREF(__pyx_t_2);
5555 #else
5556 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
5557 __Pyx_GOTREF(__pyx_t_1);
5558 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 195, __pyx_L1_error)
5559 __Pyx_GOTREF(__pyx_t_2);
5560 #endif
5561 } else {
5562 Py_ssize_t index = -1;
5563 __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
5564 __Pyx_GOTREF(__pyx_t_3);
5565 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
5566 index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
5567 __Pyx_GOTREF(__pyx_t_1);
5568 index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
5569 __Pyx_GOTREF(__pyx_t_2);
5570 if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
5571 __pyx_t_4 = NULL;
5572 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5573 goto __pyx_L4_unpacking_done;
5574 __pyx_L3_unpacking_failed:;
5575 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5576 __pyx_t_4 = NULL;
5577 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5578 __PYX_ERR(0, 195, __pyx_L1_error)
5579 __pyx_L4_unpacking_done:;
5580 }
5581 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
5582 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5583 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
5584 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5585
5586 /* "pygame_sdl2/rect.pyx":194
5587 * def __get__(self):
5588 * return (self.left, self.centery)
5589 * def __set__(self, val): # <<<<<<<<<<<<<<
5590 * self.left, self.centery = val
5591 *
5592 */
5593
5594 /* function exit code */
5595 __pyx_r = 0;
5596 goto __pyx_L0;
5597 __pyx_L1_error:;
5598 __Pyx_XDECREF(__pyx_t_1);
5599 __Pyx_XDECREF(__pyx_t_2);
5600 __Pyx_XDECREF(__pyx_t_3);
5601 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midleft.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5602 __pyx_r = -1;
5603 __pyx_L0:;
5604 __Pyx_RefNannyFinishContext();
5605 return __pyx_r;
5606 }
5607
5608 /* "pygame_sdl2/rect.pyx":198
5609 *
5610 * property midbottom:
5611 * def __get__(self): # <<<<<<<<<<<<<<
5612 * return (self.centerx, self.bottom)
5613 * def __set__(self, val):
5614 */
5615
5616 /* Python wrapper */
5617 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject * __pyx_v_self)5618 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(PyObject *__pyx_v_self) {
5619 PyObject *__pyx_r = 0;
5620 __Pyx_RefNannyDeclarations
5621 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5622 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
5623
5624 /* function exit code */
5625 __Pyx_RefNannyFinishContext();
5626 return __pyx_r;
5627 }
5628
__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)5629 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
5630 PyObject *__pyx_r = NULL;
5631 __Pyx_RefNannyDeclarations
5632 PyObject *__pyx_t_1 = NULL;
5633 PyObject *__pyx_t_2 = NULL;
5634 PyObject *__pyx_t_3 = NULL;
5635 int __pyx_lineno = 0;
5636 const char *__pyx_filename = NULL;
5637 int __pyx_clineno = 0;
5638 __Pyx_RefNannySetupContext("__get__", 0);
5639
5640 /* "pygame_sdl2/rect.pyx":199
5641 * property midbottom:
5642 * def __get__(self):
5643 * return (self.centerx, self.bottom) # <<<<<<<<<<<<<<
5644 * def __set__(self, val):
5645 * self.centerx, self.bottom = val
5646 */
5647 __Pyx_XDECREF(__pyx_r);
5648 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error)
5649 __Pyx_GOTREF(__pyx_t_1);
5650 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 199, __pyx_L1_error)
5651 __Pyx_GOTREF(__pyx_t_2);
5652 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
5653 __Pyx_GOTREF(__pyx_t_3);
5654 __Pyx_GIVEREF(__pyx_t_1);
5655 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
5656 __Pyx_GIVEREF(__pyx_t_2);
5657 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
5658 __pyx_t_1 = 0;
5659 __pyx_t_2 = 0;
5660 __pyx_r = __pyx_t_3;
5661 __pyx_t_3 = 0;
5662 goto __pyx_L0;
5663
5664 /* "pygame_sdl2/rect.pyx":198
5665 *
5666 * property midbottom:
5667 * def __get__(self): # <<<<<<<<<<<<<<
5668 * return (self.centerx, self.bottom)
5669 * def __set__(self, val):
5670 */
5671
5672 /* function exit code */
5673 __pyx_L1_error:;
5674 __Pyx_XDECREF(__pyx_t_1);
5675 __Pyx_XDECREF(__pyx_t_2);
5676 __Pyx_XDECREF(__pyx_t_3);
5677 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midbottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5678 __pyx_r = NULL;
5679 __pyx_L0:;
5680 __Pyx_XGIVEREF(__pyx_r);
5681 __Pyx_RefNannyFinishContext();
5682 return __pyx_r;
5683 }
5684
5685 /* "pygame_sdl2/rect.pyx":200
5686 * def __get__(self):
5687 * return (self.centerx, self.bottom)
5688 * def __set__(self, val): # <<<<<<<<<<<<<<
5689 * self.centerx, self.bottom = val
5690 *
5691 */
5692
5693 /* Python wrapper */
5694 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)5695 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
5696 int __pyx_r;
5697 __Pyx_RefNannyDeclarations
5698 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5699 __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));
5700
5701 /* function exit code */
5702 __Pyx_RefNannyFinishContext();
5703 return __pyx_r;
5704 }
5705
__pyx_pf_11pygame_sdl2_4rect_4Rect_9midbottom_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)5706 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) {
5707 int __pyx_r;
5708 __Pyx_RefNannyDeclarations
5709 PyObject *__pyx_t_1 = NULL;
5710 PyObject *__pyx_t_2 = NULL;
5711 PyObject *__pyx_t_3 = NULL;
5712 PyObject *(*__pyx_t_4)(PyObject *);
5713 int __pyx_lineno = 0;
5714 const char *__pyx_filename = NULL;
5715 int __pyx_clineno = 0;
5716 __Pyx_RefNannySetupContext("__set__", 0);
5717
5718 /* "pygame_sdl2/rect.pyx":201
5719 * return (self.centerx, self.bottom)
5720 * def __set__(self, val):
5721 * self.centerx, self.bottom = val # <<<<<<<<<<<<<<
5722 *
5723 * property midright:
5724 */
5725 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
5726 PyObject* sequence = __pyx_v_val;
5727 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5728 if (unlikely(size != 2)) {
5729 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5730 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5731 __PYX_ERR(0, 201, __pyx_L1_error)
5732 }
5733 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5734 if (likely(PyTuple_CheckExact(sequence))) {
5735 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
5736 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
5737 } else {
5738 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
5739 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
5740 }
5741 __Pyx_INCREF(__pyx_t_1);
5742 __Pyx_INCREF(__pyx_t_2);
5743 #else
5744 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
5745 __Pyx_GOTREF(__pyx_t_1);
5746 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
5747 __Pyx_GOTREF(__pyx_t_2);
5748 #endif
5749 } else {
5750 Py_ssize_t index = -1;
5751 __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
5752 __Pyx_GOTREF(__pyx_t_3);
5753 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
5754 index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
5755 __Pyx_GOTREF(__pyx_t_1);
5756 index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
5757 __Pyx_GOTREF(__pyx_t_2);
5758 if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
5759 __pyx_t_4 = NULL;
5760 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5761 goto __pyx_L4_unpacking_done;
5762 __pyx_L3_unpacking_failed:;
5763 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5764 __pyx_t_4 = NULL;
5765 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5766 __PYX_ERR(0, 201, __pyx_L1_error)
5767 __pyx_L4_unpacking_done:;
5768 }
5769 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centerx, __pyx_t_1) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
5770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5771 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_2) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
5772 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5773
5774 /* "pygame_sdl2/rect.pyx":200
5775 * def __get__(self):
5776 * return (self.centerx, self.bottom)
5777 * def __set__(self, val): # <<<<<<<<<<<<<<
5778 * self.centerx, self.bottom = val
5779 *
5780 */
5781
5782 /* function exit code */
5783 __pyx_r = 0;
5784 goto __pyx_L0;
5785 __pyx_L1_error:;
5786 __Pyx_XDECREF(__pyx_t_1);
5787 __Pyx_XDECREF(__pyx_t_2);
5788 __Pyx_XDECREF(__pyx_t_3);
5789 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midbottom.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5790 __pyx_r = -1;
5791 __pyx_L0:;
5792 __Pyx_RefNannyFinishContext();
5793 return __pyx_r;
5794 }
5795
5796 /* "pygame_sdl2/rect.pyx":204
5797 *
5798 * property midright:
5799 * def __get__(self): # <<<<<<<<<<<<<<
5800 * return (self.right, self.centery)
5801 * def __set__(self, val):
5802 */
5803
5804 /* Python wrapper */
5805 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject * __pyx_v_self)5806 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(PyObject *__pyx_v_self) {
5807 PyObject *__pyx_r = 0;
5808 __Pyx_RefNannyDeclarations
5809 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
5810 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
5811
5812 /* function exit code */
5813 __Pyx_RefNannyFinishContext();
5814 return __pyx_r;
5815 }
5816
__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)5817 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
5818 PyObject *__pyx_r = NULL;
5819 __Pyx_RefNannyDeclarations
5820 PyObject *__pyx_t_1 = NULL;
5821 PyObject *__pyx_t_2 = NULL;
5822 PyObject *__pyx_t_3 = NULL;
5823 int __pyx_lineno = 0;
5824 const char *__pyx_filename = NULL;
5825 int __pyx_clineno = 0;
5826 __Pyx_RefNannySetupContext("__get__", 0);
5827
5828 /* "pygame_sdl2/rect.pyx":205
5829 * property midright:
5830 * def __get__(self):
5831 * return (self.right, self.centery) # <<<<<<<<<<<<<<
5832 * def __set__(self, val):
5833 * self.right, self.centery = val
5834 */
5835 __Pyx_XDECREF(__pyx_r);
5836 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
5837 __Pyx_GOTREF(__pyx_t_1);
5838 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 205, __pyx_L1_error)
5839 __Pyx_GOTREF(__pyx_t_2);
5840 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error)
5841 __Pyx_GOTREF(__pyx_t_3);
5842 __Pyx_GIVEREF(__pyx_t_1);
5843 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
5844 __Pyx_GIVEREF(__pyx_t_2);
5845 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
5846 __pyx_t_1 = 0;
5847 __pyx_t_2 = 0;
5848 __pyx_r = __pyx_t_3;
5849 __pyx_t_3 = 0;
5850 goto __pyx_L0;
5851
5852 /* "pygame_sdl2/rect.pyx":204
5853 *
5854 * property midright:
5855 * def __get__(self): # <<<<<<<<<<<<<<
5856 * return (self.right, self.centery)
5857 * def __set__(self, val):
5858 */
5859
5860 /* function exit code */
5861 __pyx_L1_error:;
5862 __Pyx_XDECREF(__pyx_t_1);
5863 __Pyx_XDECREF(__pyx_t_2);
5864 __Pyx_XDECREF(__pyx_t_3);
5865 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midright.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5866 __pyx_r = NULL;
5867 __pyx_L0:;
5868 __Pyx_XGIVEREF(__pyx_r);
5869 __Pyx_RefNannyFinishContext();
5870 return __pyx_r;
5871 }
5872
5873 /* "pygame_sdl2/rect.pyx":206
5874 * def __get__(self):
5875 * return (self.right, self.centery)
5876 * def __set__(self, val): # <<<<<<<<<<<<<<
5877 * self.right, self.centery = val
5878 *
5879 */
5880
5881 /* Python wrapper */
5882 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_val)5883 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
5884 int __pyx_r;
5885 __Pyx_RefNannyDeclarations
5886 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
5887 __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));
5888
5889 /* function exit code */
5890 __Pyx_RefNannyFinishContext();
5891 return __pyx_r;
5892 }
5893
__pyx_pf_11pygame_sdl2_4rect_4Rect_8midright_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_val)5894 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) {
5895 int __pyx_r;
5896 __Pyx_RefNannyDeclarations
5897 PyObject *__pyx_t_1 = NULL;
5898 PyObject *__pyx_t_2 = NULL;
5899 PyObject *__pyx_t_3 = NULL;
5900 PyObject *(*__pyx_t_4)(PyObject *);
5901 int __pyx_lineno = 0;
5902 const char *__pyx_filename = NULL;
5903 int __pyx_clineno = 0;
5904 __Pyx_RefNannySetupContext("__set__", 0);
5905
5906 /* "pygame_sdl2/rect.pyx":207
5907 * return (self.right, self.centery)
5908 * def __set__(self, val):
5909 * self.right, self.centery = val # <<<<<<<<<<<<<<
5910 *
5911 * def copy(self):
5912 */
5913 if ((likely(PyTuple_CheckExact(__pyx_v_val))) || (PyList_CheckExact(__pyx_v_val))) {
5914 PyObject* sequence = __pyx_v_val;
5915 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
5916 if (unlikely(size != 2)) {
5917 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
5918 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
5919 __PYX_ERR(0, 207, __pyx_L1_error)
5920 }
5921 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5922 if (likely(PyTuple_CheckExact(sequence))) {
5923 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
5924 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
5925 } else {
5926 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
5927 __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
5928 }
5929 __Pyx_INCREF(__pyx_t_1);
5930 __Pyx_INCREF(__pyx_t_2);
5931 #else
5932 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
5933 __Pyx_GOTREF(__pyx_t_1);
5934 __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
5935 __Pyx_GOTREF(__pyx_t_2);
5936 #endif
5937 } else {
5938 Py_ssize_t index = -1;
5939 __pyx_t_3 = PyObject_GetIter(__pyx_v_val); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
5940 __Pyx_GOTREF(__pyx_t_3);
5941 __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
5942 index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
5943 __Pyx_GOTREF(__pyx_t_1);
5944 index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
5945 __Pyx_GOTREF(__pyx_t_2);
5946 if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
5947 __pyx_t_4 = NULL;
5948 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5949 goto __pyx_L4_unpacking_done;
5950 __pyx_L3_unpacking_failed:;
5951 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5952 __pyx_t_4 = NULL;
5953 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
5954 __PYX_ERR(0, 207, __pyx_L1_error)
5955 __pyx_L4_unpacking_done:;
5956 }
5957 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_1) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
5958 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5959 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_centery, __pyx_t_2) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
5960 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5961
5962 /* "pygame_sdl2/rect.pyx":206
5963 * def __get__(self):
5964 * return (self.right, self.centery)
5965 * def __set__(self, val): # <<<<<<<<<<<<<<
5966 * self.right, self.centery = val
5967 *
5968 */
5969
5970 /* function exit code */
5971 __pyx_r = 0;
5972 goto __pyx_L0;
5973 __pyx_L1_error:;
5974 __Pyx_XDECREF(__pyx_t_1);
5975 __Pyx_XDECREF(__pyx_t_2);
5976 __Pyx_XDECREF(__pyx_t_3);
5977 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.midright.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5978 __pyx_r = -1;
5979 __pyx_L0:;
5980 __Pyx_RefNannyFinishContext();
5981 return __pyx_r;
5982 }
5983
5984 /* "pygame_sdl2/rect.pyx":209
5985 * self.right, self.centery = val
5986 *
5987 * def copy(self): # <<<<<<<<<<<<<<
5988 * return Rect(self)
5989 *
5990 */
5991
5992 /* Python wrapper */
5993 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)5994 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5995 PyObject *__pyx_r = 0;
5996 __Pyx_RefNannyDeclarations
5997 __Pyx_RefNannySetupContext("copy (wrapper)", 0);
5998 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
5999
6000 /* function exit code */
6001 __Pyx_RefNannyFinishContext();
6002 return __pyx_r;
6003 }
6004
__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)6005 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_16copy(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
6006 PyObject *__pyx_r = NULL;
6007 __Pyx_RefNannyDeclarations
6008 PyObject *__pyx_t_1 = NULL;
6009 int __pyx_lineno = 0;
6010 const char *__pyx_filename = NULL;
6011 int __pyx_clineno = 0;
6012 __Pyx_RefNannySetupContext("copy", 0);
6013
6014 /* "pygame_sdl2/rect.pyx":210
6015 *
6016 * def copy(self):
6017 * return Rect(self) # <<<<<<<<<<<<<<
6018 *
6019 * def move(self, *args):
6020 */
6021 __Pyx_XDECREF(__pyx_r);
6022 __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error)
6023 __Pyx_GOTREF(__pyx_t_1);
6024 __pyx_r = __pyx_t_1;
6025 __pyx_t_1 = 0;
6026 goto __pyx_L0;
6027
6028 /* "pygame_sdl2/rect.pyx":209
6029 * self.right, self.centery = val
6030 *
6031 * def copy(self): # <<<<<<<<<<<<<<
6032 * return Rect(self)
6033 *
6034 */
6035
6036 /* function exit code */
6037 __pyx_L1_error:;
6038 __Pyx_XDECREF(__pyx_t_1);
6039 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
6040 __pyx_r = NULL;
6041 __pyx_L0:;
6042 __Pyx_XGIVEREF(__pyx_r);
6043 __Pyx_RefNannyFinishContext();
6044 return __pyx_r;
6045 }
6046
6047 /* "pygame_sdl2/rect.pyx":212
6048 * return Rect(self)
6049 *
6050 * def move(self, *args): # <<<<<<<<<<<<<<
6051 * r = self.copy()
6052 * r.move_ip(*args)
6053 */
6054
6055 /* Python wrapper */
6056 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6057 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_19move(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6058 PyObject *__pyx_v_args = 0;
6059 PyObject *__pyx_r = 0;
6060 __Pyx_RefNannyDeclarations
6061 __Pyx_RefNannySetupContext("move (wrapper)", 0);
6062 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "move", 0))) return NULL;
6063 __Pyx_INCREF(__pyx_args);
6064 __pyx_v_args = __pyx_args;
6065 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_18move(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args);
6066
6067 /* function exit code */
6068 __Pyx_XDECREF(__pyx_v_args);
6069 __Pyx_RefNannyFinishContext();
6070 return __pyx_r;
6071 }
6072
__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_args)6073 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_18move(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) {
6074 PyObject *__pyx_v_r = NULL;
6075 PyObject *__pyx_r = NULL;
6076 __Pyx_RefNannyDeclarations
6077 PyObject *__pyx_t_1 = NULL;
6078 PyObject *__pyx_t_2 = NULL;
6079 PyObject *__pyx_t_3 = NULL;
6080 int __pyx_lineno = 0;
6081 const char *__pyx_filename = NULL;
6082 int __pyx_clineno = 0;
6083 __Pyx_RefNannySetupContext("move", 0);
6084
6085 /* "pygame_sdl2/rect.pyx":213
6086 *
6087 * def move(self, *args):
6088 * r = self.copy() # <<<<<<<<<<<<<<
6089 * r.move_ip(*args)
6090 * return r
6091 */
6092 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 213, __pyx_L1_error)
6093 __Pyx_GOTREF(__pyx_t_2);
6094 __pyx_t_3 = NULL;
6095 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6096 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6097 if (likely(__pyx_t_3)) {
6098 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6099 __Pyx_INCREF(__pyx_t_3);
6100 __Pyx_INCREF(function);
6101 __Pyx_DECREF_SET(__pyx_t_2, function);
6102 }
6103 }
6104 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6105 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6106 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 213, __pyx_L1_error)
6107 __Pyx_GOTREF(__pyx_t_1);
6108 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6109 __pyx_v_r = __pyx_t_1;
6110 __pyx_t_1 = 0;
6111
6112 /* "pygame_sdl2/rect.pyx":214
6113 * def move(self, *args):
6114 * r = self.copy()
6115 * r.move_ip(*args) # <<<<<<<<<<<<<<
6116 * return r
6117 *
6118 */
6119 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_move_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 214, __pyx_L1_error)
6120 __Pyx_GOTREF(__pyx_t_1);
6121 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 214, __pyx_L1_error)
6122 __Pyx_GOTREF(__pyx_t_2);
6123 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6124 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6125
6126 /* "pygame_sdl2/rect.pyx":215
6127 * r = self.copy()
6128 * r.move_ip(*args)
6129 * return r # <<<<<<<<<<<<<<
6130 *
6131 * def move_ip(self, *args):
6132 */
6133 __Pyx_XDECREF(__pyx_r);
6134 __Pyx_INCREF(__pyx_v_r);
6135 __pyx_r = __pyx_v_r;
6136 goto __pyx_L0;
6137
6138 /* "pygame_sdl2/rect.pyx":212
6139 * return Rect(self)
6140 *
6141 * def move(self, *args): # <<<<<<<<<<<<<<
6142 * r = self.copy()
6143 * r.move_ip(*args)
6144 */
6145
6146 /* function exit code */
6147 __pyx_L1_error:;
6148 __Pyx_XDECREF(__pyx_t_1);
6149 __Pyx_XDECREF(__pyx_t_2);
6150 __Pyx_XDECREF(__pyx_t_3);
6151 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.move", __pyx_clineno, __pyx_lineno, __pyx_filename);
6152 __pyx_r = NULL;
6153 __pyx_L0:;
6154 __Pyx_XDECREF(__pyx_v_r);
6155 __Pyx_XGIVEREF(__pyx_r);
6156 __Pyx_RefNannyFinishContext();
6157 return __pyx_r;
6158 }
6159
6160 /* "pygame_sdl2/rect.pyx":217
6161 * return r
6162 *
6163 * def move_ip(self, *args): # <<<<<<<<<<<<<<
6164 * x, y = flatten(args)
6165 * self.x += x
6166 */
6167
6168 /* Python wrapper */
6169 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6170 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6171 PyObject *__pyx_v_args = 0;
6172 PyObject *__pyx_r = 0;
6173 __Pyx_RefNannyDeclarations
6174 __Pyx_RefNannySetupContext("move_ip (wrapper)", 0);
6175 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "move_ip", 0))) return NULL;
6176 __Pyx_INCREF(__pyx_args);
6177 __pyx_v_args = __pyx_args;
6178 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args);
6179
6180 /* function exit code */
6181 __Pyx_XDECREF(__pyx_v_args);
6182 __Pyx_RefNannyFinishContext();
6183 return __pyx_r;
6184 }
6185
__pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_args)6186 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_20move_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) {
6187 PyObject *__pyx_v_x = NULL;
6188 PyObject *__pyx_v_y = NULL;
6189 PyObject *__pyx_r = NULL;
6190 __Pyx_RefNannyDeclarations
6191 PyObject *__pyx_t_1 = NULL;
6192 PyObject *__pyx_t_2 = NULL;
6193 PyObject *__pyx_t_3 = NULL;
6194 PyObject *__pyx_t_4 = NULL;
6195 PyObject *(*__pyx_t_5)(PyObject *);
6196 int __pyx_t_6;
6197 int __pyx_lineno = 0;
6198 const char *__pyx_filename = NULL;
6199 int __pyx_clineno = 0;
6200 __Pyx_RefNannySetupContext("move_ip", 0);
6201
6202 /* "pygame_sdl2/rect.pyx":218
6203 *
6204 * def move_ip(self, *args):
6205 * x, y = flatten(args) # <<<<<<<<<<<<<<
6206 * self.x += x
6207 * self.y += y
6208 */
6209 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
6210 __Pyx_GOTREF(__pyx_t_2);
6211 __pyx_t_3 = NULL;
6212 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6213 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6214 if (likely(__pyx_t_3)) {
6215 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6216 __Pyx_INCREF(__pyx_t_3);
6217 __Pyx_INCREF(function);
6218 __Pyx_DECREF_SET(__pyx_t_2, function);
6219 }
6220 }
6221 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args);
6222 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6223 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
6224 __Pyx_GOTREF(__pyx_t_1);
6225 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6226 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
6227 PyObject* sequence = __pyx_t_1;
6228 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6229 if (unlikely(size != 2)) {
6230 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6231 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6232 __PYX_ERR(0, 218, __pyx_L1_error)
6233 }
6234 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6235 if (likely(PyTuple_CheckExact(sequence))) {
6236 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
6237 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
6238 } else {
6239 __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
6240 __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
6241 }
6242 __Pyx_INCREF(__pyx_t_2);
6243 __Pyx_INCREF(__pyx_t_3);
6244 #else
6245 __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
6246 __Pyx_GOTREF(__pyx_t_2);
6247 __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error)
6248 __Pyx_GOTREF(__pyx_t_3);
6249 #endif
6250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6251 } else {
6252 Py_ssize_t index = -1;
6253 __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 218, __pyx_L1_error)
6254 __Pyx_GOTREF(__pyx_t_4);
6255 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6256 __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
6257 index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
6258 __Pyx_GOTREF(__pyx_t_2);
6259 index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
6260 __Pyx_GOTREF(__pyx_t_3);
6261 if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
6262 __pyx_t_5 = NULL;
6263 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6264 goto __pyx_L4_unpacking_done;
6265 __pyx_L3_unpacking_failed:;
6266 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6267 __pyx_t_5 = NULL;
6268 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6269 __PYX_ERR(0, 218, __pyx_L1_error)
6270 __pyx_L4_unpacking_done:;
6271 }
6272 __pyx_v_x = __pyx_t_2;
6273 __pyx_t_2 = 0;
6274 __pyx_v_y = __pyx_t_3;
6275 __pyx_t_3 = 0;
6276
6277 /* "pygame_sdl2/rect.pyx":219
6278 * def move_ip(self, *args):
6279 * x, y = flatten(args)
6280 * self.x += x # <<<<<<<<<<<<<<
6281 * self.y += y
6282 *
6283 */
6284 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 219, __pyx_L1_error)
6285 __Pyx_GOTREF(__pyx_t_1);
6286 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 219, __pyx_L1_error)
6287 __Pyx_GOTREF(__pyx_t_3);
6288 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6289 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 219, __pyx_L1_error)
6290 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6291 __pyx_v_self->x = __pyx_t_6;
6292
6293 /* "pygame_sdl2/rect.pyx":220
6294 * x, y = flatten(args)
6295 * self.x += x
6296 * self.y += y # <<<<<<<<<<<<<<
6297 *
6298 * def inflate(self, *args):
6299 */
6300 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
6301 __Pyx_GOTREF(__pyx_t_3);
6302 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
6303 __Pyx_GOTREF(__pyx_t_1);
6304 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6305 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 220, __pyx_L1_error)
6306 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6307 __pyx_v_self->y = __pyx_t_6;
6308
6309 /* "pygame_sdl2/rect.pyx":217
6310 * return r
6311 *
6312 * def move_ip(self, *args): # <<<<<<<<<<<<<<
6313 * x, y = flatten(args)
6314 * self.x += x
6315 */
6316
6317 /* function exit code */
6318 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6319 goto __pyx_L0;
6320 __pyx_L1_error:;
6321 __Pyx_XDECREF(__pyx_t_1);
6322 __Pyx_XDECREF(__pyx_t_2);
6323 __Pyx_XDECREF(__pyx_t_3);
6324 __Pyx_XDECREF(__pyx_t_4);
6325 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.move_ip", __pyx_clineno, __pyx_lineno, __pyx_filename);
6326 __pyx_r = NULL;
6327 __pyx_L0:;
6328 __Pyx_XDECREF(__pyx_v_x);
6329 __Pyx_XDECREF(__pyx_v_y);
6330 __Pyx_XGIVEREF(__pyx_r);
6331 __Pyx_RefNannyFinishContext();
6332 return __pyx_r;
6333 }
6334
6335 /* "pygame_sdl2/rect.pyx":222
6336 * self.y += y
6337 *
6338 * def inflate(self, *args): # <<<<<<<<<<<<<<
6339 * r = self.copy()
6340 * r.inflate_ip(*args)
6341 */
6342
6343 /* Python wrapper */
6344 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6345 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6346 PyObject *__pyx_v_args = 0;
6347 PyObject *__pyx_r = 0;
6348 __Pyx_RefNannyDeclarations
6349 __Pyx_RefNannySetupContext("inflate (wrapper)", 0);
6350 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inflate", 0))) return NULL;
6351 __Pyx_INCREF(__pyx_args);
6352 __pyx_v_args = __pyx_args;
6353 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args);
6354
6355 /* function exit code */
6356 __Pyx_XDECREF(__pyx_v_args);
6357 __Pyx_RefNannyFinishContext();
6358 return __pyx_r;
6359 }
6360
__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_args)6361 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_22inflate(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) {
6362 PyObject *__pyx_v_r = NULL;
6363 PyObject *__pyx_r = NULL;
6364 __Pyx_RefNannyDeclarations
6365 PyObject *__pyx_t_1 = NULL;
6366 PyObject *__pyx_t_2 = NULL;
6367 PyObject *__pyx_t_3 = NULL;
6368 int __pyx_lineno = 0;
6369 const char *__pyx_filename = NULL;
6370 int __pyx_clineno = 0;
6371 __Pyx_RefNannySetupContext("inflate", 0);
6372
6373 /* "pygame_sdl2/rect.pyx":223
6374 *
6375 * def inflate(self, *args):
6376 * r = self.copy() # <<<<<<<<<<<<<<
6377 * r.inflate_ip(*args)
6378 * return r
6379 */
6380 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
6381 __Pyx_GOTREF(__pyx_t_2);
6382 __pyx_t_3 = NULL;
6383 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6384 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6385 if (likely(__pyx_t_3)) {
6386 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6387 __Pyx_INCREF(__pyx_t_3);
6388 __Pyx_INCREF(function);
6389 __Pyx_DECREF_SET(__pyx_t_2, function);
6390 }
6391 }
6392 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6393 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6394 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
6395 __Pyx_GOTREF(__pyx_t_1);
6396 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6397 __pyx_v_r = __pyx_t_1;
6398 __pyx_t_1 = 0;
6399
6400 /* "pygame_sdl2/rect.pyx":224
6401 * def inflate(self, *args):
6402 * r = self.copy()
6403 * r.inflate_ip(*args) # <<<<<<<<<<<<<<
6404 * return r
6405 *
6406 */
6407 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_inflate_ip); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 224, __pyx_L1_error)
6408 __Pyx_GOTREF(__pyx_t_1);
6409 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 224, __pyx_L1_error)
6410 __Pyx_GOTREF(__pyx_t_2);
6411 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6412 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6413
6414 /* "pygame_sdl2/rect.pyx":225
6415 * r = self.copy()
6416 * r.inflate_ip(*args)
6417 * return r # <<<<<<<<<<<<<<
6418 *
6419 * def inflate_ip(self, *args):
6420 */
6421 __Pyx_XDECREF(__pyx_r);
6422 __Pyx_INCREF(__pyx_v_r);
6423 __pyx_r = __pyx_v_r;
6424 goto __pyx_L0;
6425
6426 /* "pygame_sdl2/rect.pyx":222
6427 * self.y += y
6428 *
6429 * def inflate(self, *args): # <<<<<<<<<<<<<<
6430 * r = self.copy()
6431 * r.inflate_ip(*args)
6432 */
6433
6434 /* function exit code */
6435 __pyx_L1_error:;
6436 __Pyx_XDECREF(__pyx_t_1);
6437 __Pyx_XDECREF(__pyx_t_2);
6438 __Pyx_XDECREF(__pyx_t_3);
6439 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.inflate", __pyx_clineno, __pyx_lineno, __pyx_filename);
6440 __pyx_r = NULL;
6441 __pyx_L0:;
6442 __Pyx_XDECREF(__pyx_v_r);
6443 __Pyx_XGIVEREF(__pyx_r);
6444 __Pyx_RefNannyFinishContext();
6445 return __pyx_r;
6446 }
6447
6448 /* "pygame_sdl2/rect.pyx":227
6449 * return r
6450 *
6451 * def inflate_ip(self, *args): # <<<<<<<<<<<<<<
6452 * x, y = flatten(args)
6453 * c = self.center
6454 */
6455
6456 /* Python wrapper */
6457 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6458 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6459 PyObject *__pyx_v_args = 0;
6460 PyObject *__pyx_r = 0;
6461 __Pyx_RefNannyDeclarations
6462 __Pyx_RefNannySetupContext("inflate_ip (wrapper)", 0);
6463 if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inflate_ip", 0))) return NULL;
6464 __Pyx_INCREF(__pyx_args);
6465 __pyx_v_args = __pyx_args;
6466 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), __pyx_v_args);
6467
6468 /* function exit code */
6469 __Pyx_XDECREF(__pyx_v_args);
6470 __Pyx_RefNannyFinishContext();
6471 return __pyx_r;
6472 }
6473
__pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_args)6474 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_24inflate_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_args) {
6475 PyObject *__pyx_v_x = NULL;
6476 PyObject *__pyx_v_y = NULL;
6477 PyObject *__pyx_v_c = NULL;
6478 PyObject *__pyx_r = NULL;
6479 __Pyx_RefNannyDeclarations
6480 PyObject *__pyx_t_1 = NULL;
6481 PyObject *__pyx_t_2 = NULL;
6482 PyObject *__pyx_t_3 = NULL;
6483 PyObject *__pyx_t_4 = NULL;
6484 PyObject *(*__pyx_t_5)(PyObject *);
6485 int __pyx_t_6;
6486 int __pyx_lineno = 0;
6487 const char *__pyx_filename = NULL;
6488 int __pyx_clineno = 0;
6489 __Pyx_RefNannySetupContext("inflate_ip", 0);
6490
6491 /* "pygame_sdl2/rect.pyx":228
6492 *
6493 * def inflate_ip(self, *args):
6494 * x, y = flatten(args) # <<<<<<<<<<<<<<
6495 * c = self.center
6496 * self.w += x
6497 */
6498 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_flatten); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
6499 __Pyx_GOTREF(__pyx_t_2);
6500 __pyx_t_3 = NULL;
6501 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6502 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6503 if (likely(__pyx_t_3)) {
6504 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6505 __Pyx_INCREF(__pyx_t_3);
6506 __Pyx_INCREF(function);
6507 __Pyx_DECREF_SET(__pyx_t_2, function);
6508 }
6509 }
6510 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args);
6511 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6512 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error)
6513 __Pyx_GOTREF(__pyx_t_1);
6514 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6515 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
6516 PyObject* sequence = __pyx_t_1;
6517 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6518 if (unlikely(size != 2)) {
6519 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6520 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6521 __PYX_ERR(0, 228, __pyx_L1_error)
6522 }
6523 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6524 if (likely(PyTuple_CheckExact(sequence))) {
6525 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
6526 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
6527 } else {
6528 __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
6529 __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
6530 }
6531 __Pyx_INCREF(__pyx_t_2);
6532 __Pyx_INCREF(__pyx_t_3);
6533 #else
6534 __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
6535 __Pyx_GOTREF(__pyx_t_2);
6536 __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
6537 __Pyx_GOTREF(__pyx_t_3);
6538 #endif
6539 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6540 } else {
6541 Py_ssize_t index = -1;
6542 __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
6543 __Pyx_GOTREF(__pyx_t_4);
6544 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6545 __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
6546 index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
6547 __Pyx_GOTREF(__pyx_t_2);
6548 index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
6549 __Pyx_GOTREF(__pyx_t_3);
6550 if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
6551 __pyx_t_5 = NULL;
6552 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6553 goto __pyx_L4_unpacking_done;
6554 __pyx_L3_unpacking_failed:;
6555 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6556 __pyx_t_5 = NULL;
6557 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
6558 __PYX_ERR(0, 228, __pyx_L1_error)
6559 __pyx_L4_unpacking_done:;
6560 }
6561 __pyx_v_x = __pyx_t_2;
6562 __pyx_t_2 = 0;
6563 __pyx_v_y = __pyx_t_3;
6564 __pyx_t_3 = 0;
6565
6566 /* "pygame_sdl2/rect.pyx":229
6567 * def inflate_ip(self, *args):
6568 * x, y = flatten(args)
6569 * c = self.center # <<<<<<<<<<<<<<
6570 * self.w += x
6571 * self.h += y
6572 */
6573 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
6574 __Pyx_GOTREF(__pyx_t_1);
6575 __pyx_v_c = __pyx_t_1;
6576 __pyx_t_1 = 0;
6577
6578 /* "pygame_sdl2/rect.pyx":230
6579 * x, y = flatten(args)
6580 * c = self.center
6581 * self.w += x # <<<<<<<<<<<<<<
6582 * self.h += y
6583 * self.center = c
6584 */
6585 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
6586 __Pyx_GOTREF(__pyx_t_1);
6587 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error)
6588 __Pyx_GOTREF(__pyx_t_3);
6589 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6590 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 230, __pyx_L1_error)
6591 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6592 __pyx_v_self->w = __pyx_t_6;
6593
6594 /* "pygame_sdl2/rect.pyx":231
6595 * c = self.center
6596 * self.w += x
6597 * self.h += y # <<<<<<<<<<<<<<
6598 * self.center = c
6599 *
6600 */
6601 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
6602 __Pyx_GOTREF(__pyx_t_3);
6603 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
6604 __Pyx_GOTREF(__pyx_t_1);
6605 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6606 __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error)
6607 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6608 __pyx_v_self->h = __pyx_t_6;
6609
6610 /* "pygame_sdl2/rect.pyx":232
6611 * self.w += x
6612 * self.h += y
6613 * self.center = c # <<<<<<<<<<<<<<
6614 *
6615 * def clamp(self, other):
6616 */
6617 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_v_c) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
6618
6619 /* "pygame_sdl2/rect.pyx":227
6620 * return r
6621 *
6622 * def inflate_ip(self, *args): # <<<<<<<<<<<<<<
6623 * x, y = flatten(args)
6624 * c = self.center
6625 */
6626
6627 /* function exit code */
6628 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6629 goto __pyx_L0;
6630 __pyx_L1_error:;
6631 __Pyx_XDECREF(__pyx_t_1);
6632 __Pyx_XDECREF(__pyx_t_2);
6633 __Pyx_XDECREF(__pyx_t_3);
6634 __Pyx_XDECREF(__pyx_t_4);
6635 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.inflate_ip", __pyx_clineno, __pyx_lineno, __pyx_filename);
6636 __pyx_r = NULL;
6637 __pyx_L0:;
6638 __Pyx_XDECREF(__pyx_v_x);
6639 __Pyx_XDECREF(__pyx_v_y);
6640 __Pyx_XDECREF(__pyx_v_c);
6641 __Pyx_XGIVEREF(__pyx_r);
6642 __Pyx_RefNannyFinishContext();
6643 return __pyx_r;
6644 }
6645
6646 /* "pygame_sdl2/rect.pyx":234
6647 * self.center = c
6648 *
6649 * def clamp(self, other): # <<<<<<<<<<<<<<
6650 * r = self.copy()
6651 * r.clamp_ip(other)
6652 */
6653
6654 /* Python wrapper */
6655 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject * __pyx_v_self,PyObject * __pyx_v_other)6656 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
6657 PyObject *__pyx_r = 0;
6658 __Pyx_RefNannyDeclarations
6659 __Pyx_RefNannySetupContext("clamp (wrapper)", 0);
6660 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other));
6661
6662 /* function exit code */
6663 __Pyx_RefNannyFinishContext();
6664 return __pyx_r;
6665 }
6666
__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other)6667 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_26clamp(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) {
6668 PyObject *__pyx_v_r = NULL;
6669 PyObject *__pyx_r = NULL;
6670 __Pyx_RefNannyDeclarations
6671 PyObject *__pyx_t_1 = NULL;
6672 PyObject *__pyx_t_2 = NULL;
6673 PyObject *__pyx_t_3 = NULL;
6674 int __pyx_lineno = 0;
6675 const char *__pyx_filename = NULL;
6676 int __pyx_clineno = 0;
6677 __Pyx_RefNannySetupContext("clamp", 0);
6678
6679 /* "pygame_sdl2/rect.pyx":235
6680 *
6681 * def clamp(self, other):
6682 * r = self.copy() # <<<<<<<<<<<<<<
6683 * r.clamp_ip(other)
6684 * return r
6685 */
6686 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error)
6687 __Pyx_GOTREF(__pyx_t_2);
6688 __pyx_t_3 = NULL;
6689 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6690 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6691 if (likely(__pyx_t_3)) {
6692 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6693 __Pyx_INCREF(__pyx_t_3);
6694 __Pyx_INCREF(function);
6695 __Pyx_DECREF_SET(__pyx_t_2, function);
6696 }
6697 }
6698 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
6699 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6700 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
6701 __Pyx_GOTREF(__pyx_t_1);
6702 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6703 __pyx_v_r = __pyx_t_1;
6704 __pyx_t_1 = 0;
6705
6706 /* "pygame_sdl2/rect.pyx":236
6707 * def clamp(self, other):
6708 * r = self.copy()
6709 * r.clamp_ip(other) # <<<<<<<<<<<<<<
6710 * return r
6711 *
6712 */
6713 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_clamp_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
6714 __Pyx_GOTREF(__pyx_t_2);
6715 __pyx_t_3 = NULL;
6716 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
6717 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
6718 if (likely(__pyx_t_3)) {
6719 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6720 __Pyx_INCREF(__pyx_t_3);
6721 __Pyx_INCREF(function);
6722 __Pyx_DECREF_SET(__pyx_t_2, function);
6723 }
6724 }
6725 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other);
6726 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6727 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
6728 __Pyx_GOTREF(__pyx_t_1);
6729 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6730 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6731
6732 /* "pygame_sdl2/rect.pyx":237
6733 * r = self.copy()
6734 * r.clamp_ip(other)
6735 * return r # <<<<<<<<<<<<<<
6736 *
6737 * def clamp_ip(self, other):
6738 */
6739 __Pyx_XDECREF(__pyx_r);
6740 __Pyx_INCREF(__pyx_v_r);
6741 __pyx_r = __pyx_v_r;
6742 goto __pyx_L0;
6743
6744 /* "pygame_sdl2/rect.pyx":234
6745 * self.center = c
6746 *
6747 * def clamp(self, other): # <<<<<<<<<<<<<<
6748 * r = self.copy()
6749 * r.clamp_ip(other)
6750 */
6751
6752 /* function exit code */
6753 __pyx_L1_error:;
6754 __Pyx_XDECREF(__pyx_t_1);
6755 __Pyx_XDECREF(__pyx_t_2);
6756 __Pyx_XDECREF(__pyx_t_3);
6757 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp", __pyx_clineno, __pyx_lineno, __pyx_filename);
6758 __pyx_r = NULL;
6759 __pyx_L0:;
6760 __Pyx_XDECREF(__pyx_v_r);
6761 __Pyx_XGIVEREF(__pyx_r);
6762 __Pyx_RefNannyFinishContext();
6763 return __pyx_r;
6764 }
6765
6766 /* "pygame_sdl2/rect.pyx":239
6767 * return r
6768 *
6769 * def clamp_ip(self, other): # <<<<<<<<<<<<<<
6770 * if not isinstance(other, Rect):
6771 * other = Rect(other)
6772 */
6773
6774 /* Python wrapper */
6775 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject * __pyx_v_self,PyObject * __pyx_v_other)6776 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
6777 PyObject *__pyx_r = 0;
6778 __Pyx_RefNannyDeclarations
6779 __Pyx_RefNannySetupContext("clamp_ip (wrapper)", 0);
6780 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other));
6781
6782 /* function exit code */
6783 __Pyx_RefNannyFinishContext();
6784 return __pyx_r;
6785 }
6786
__pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other)6787 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_28clamp_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) {
6788 PyObject *__pyx_r = NULL;
6789 __Pyx_RefNannyDeclarations
6790 int __pyx_t_1;
6791 int __pyx_t_2;
6792 PyObject *__pyx_t_3 = NULL;
6793 PyObject *__pyx_t_4 = NULL;
6794 PyObject *__pyx_t_5 = NULL;
6795 int __pyx_lineno = 0;
6796 const char *__pyx_filename = NULL;
6797 int __pyx_clineno = 0;
6798 __Pyx_RefNannySetupContext("clamp_ip", 0);
6799 __Pyx_INCREF(__pyx_v_other);
6800
6801 /* "pygame_sdl2/rect.pyx":240
6802 *
6803 * def clamp_ip(self, other):
6804 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
6805 * other = Rect(other)
6806 *
6807 */
6808 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect);
6809 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
6810 if (__pyx_t_2) {
6811
6812 /* "pygame_sdl2/rect.pyx":241
6813 * def clamp_ip(self, other):
6814 * if not isinstance(other, Rect):
6815 * other = Rect(other) # <<<<<<<<<<<<<<
6816 *
6817 * if self.w > other.w or self.h > other.h:
6818 */
6819 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
6820 __Pyx_GOTREF(__pyx_t_3);
6821 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
6822 __pyx_t_3 = 0;
6823
6824 /* "pygame_sdl2/rect.pyx":240
6825 *
6826 * def clamp_ip(self, other):
6827 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
6828 * other = Rect(other)
6829 *
6830 */
6831 }
6832
6833 /* "pygame_sdl2/rect.pyx":243
6834 * other = Rect(other)
6835 *
6836 * if self.w > other.w or self.h > other.h: # <<<<<<<<<<<<<<
6837 * self.center = other.center
6838 * else:
6839 */
6840 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
6841 __Pyx_GOTREF(__pyx_t_3);
6842 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
6843 __Pyx_GOTREF(__pyx_t_4);
6844 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
6845 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6846 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6847 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
6848 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6849 if (!__pyx_t_1) {
6850 } else {
6851 __pyx_t_2 = __pyx_t_1;
6852 goto __pyx_L5_bool_binop_done;
6853 }
6854 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
6855 __Pyx_GOTREF(__pyx_t_5);
6856 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
6857 __Pyx_GOTREF(__pyx_t_4);
6858 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
6859 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6860 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6861 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 243, __pyx_L1_error)
6862 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6863 __pyx_t_2 = __pyx_t_1;
6864 __pyx_L5_bool_binop_done:;
6865 if (__pyx_t_2) {
6866
6867 /* "pygame_sdl2/rect.pyx":244
6868 *
6869 * if self.w > other.w or self.h > other.h:
6870 * self.center = other.center # <<<<<<<<<<<<<<
6871 * else:
6872 * if self.left < other.left:
6873 */
6874 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_center); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
6875 __Pyx_GOTREF(__pyx_t_3);
6876 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_center, __pyx_t_3) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
6877 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6878
6879 /* "pygame_sdl2/rect.pyx":243
6880 * other = Rect(other)
6881 *
6882 * if self.w > other.w or self.h > other.h: # <<<<<<<<<<<<<<
6883 * self.center = other.center
6884 * else:
6885 */
6886 goto __pyx_L4;
6887 }
6888
6889 /* "pygame_sdl2/rect.pyx":246
6890 * self.center = other.center
6891 * else:
6892 * if self.left < other.left: # <<<<<<<<<<<<<<
6893 * self.left = other.left
6894 * elif self.right > other.right:
6895 */
6896 /*else*/ {
6897 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error)
6898 __Pyx_GOTREF(__pyx_t_3);
6899 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
6900 __Pyx_GOTREF(__pyx_t_4);
6901 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 246, __pyx_L1_error)
6902 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6903 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6904 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 246, __pyx_L1_error)
6905 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6906 if (__pyx_t_2) {
6907
6908 /* "pygame_sdl2/rect.pyx":247
6909 * else:
6910 * if self.left < other.left:
6911 * self.left = other.left # <<<<<<<<<<<<<<
6912 * elif self.right > other.right:
6913 * self.right = other.right
6914 */
6915 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 247, __pyx_L1_error)
6916 __Pyx_GOTREF(__pyx_t_5);
6917 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left, __pyx_t_5) < 0) __PYX_ERR(0, 247, __pyx_L1_error)
6918 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6919
6920 /* "pygame_sdl2/rect.pyx":246
6921 * self.center = other.center
6922 * else:
6923 * if self.left < other.left: # <<<<<<<<<<<<<<
6924 * self.left = other.left
6925 * elif self.right > other.right:
6926 */
6927 goto __pyx_L7;
6928 }
6929
6930 /* "pygame_sdl2/rect.pyx":248
6931 * if self.left < other.left:
6932 * self.left = other.left
6933 * elif self.right > other.right: # <<<<<<<<<<<<<<
6934 * self.right = other.right
6935 * if self.top < other.top:
6936 */
6937 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
6938 __Pyx_GOTREF(__pyx_t_5);
6939 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
6940 __Pyx_GOTREF(__pyx_t_4);
6941 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
6942 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6943 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6944 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 248, __pyx_L1_error)
6945 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6946 if (__pyx_t_2) {
6947
6948 /* "pygame_sdl2/rect.pyx":249
6949 * self.left = other.left
6950 * elif self.right > other.right:
6951 * self.right = other.right # <<<<<<<<<<<<<<
6952 * if self.top < other.top:
6953 * self.top = other.top
6954 */
6955 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
6956 __Pyx_GOTREF(__pyx_t_3);
6957 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right, __pyx_t_3) < 0) __PYX_ERR(0, 249, __pyx_L1_error)
6958 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6959
6960 /* "pygame_sdl2/rect.pyx":248
6961 * if self.left < other.left:
6962 * self.left = other.left
6963 * elif self.right > other.right: # <<<<<<<<<<<<<<
6964 * self.right = other.right
6965 * if self.top < other.top:
6966 */
6967 }
6968 __pyx_L7:;
6969
6970 /* "pygame_sdl2/rect.pyx":250
6971 * elif self.right > other.right:
6972 * self.right = other.right
6973 * if self.top < other.top: # <<<<<<<<<<<<<<
6974 * self.top = other.top
6975 * elif self.bottom > other.bottom:
6976 */
6977 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
6978 __Pyx_GOTREF(__pyx_t_3);
6979 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
6980 __Pyx_GOTREF(__pyx_t_4);
6981 __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
6982 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6983 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6984 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 250, __pyx_L1_error)
6985 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6986 if (__pyx_t_2) {
6987
6988 /* "pygame_sdl2/rect.pyx":251
6989 * self.right = other.right
6990 * if self.top < other.top:
6991 * self.top = other.top # <<<<<<<<<<<<<<
6992 * elif self.bottom > other.bottom:
6993 * self.bottom = other.bottom
6994 */
6995 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 251, __pyx_L1_error)
6996 __Pyx_GOTREF(__pyx_t_5);
6997 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top, __pyx_t_5) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
6998 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6999
7000 /* "pygame_sdl2/rect.pyx":250
7001 * elif self.right > other.right:
7002 * self.right = other.right
7003 * if self.top < other.top: # <<<<<<<<<<<<<<
7004 * self.top = other.top
7005 * elif self.bottom > other.bottom:
7006 */
7007 goto __pyx_L8;
7008 }
7009
7010 /* "pygame_sdl2/rect.pyx":252
7011 * if self.top < other.top:
7012 * self.top = other.top
7013 * elif self.bottom > other.bottom: # <<<<<<<<<<<<<<
7014 * self.bottom = other.bottom
7015 *
7016 */
7017 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 252, __pyx_L1_error)
7018 __Pyx_GOTREF(__pyx_t_5);
7019 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
7020 __Pyx_GOTREF(__pyx_t_4);
7021 __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
7022 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7023 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7024 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
7025 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7026 if (__pyx_t_2) {
7027
7028 /* "pygame_sdl2/rect.pyx":253
7029 * self.top = other.top
7030 * elif self.bottom > other.bottom:
7031 * self.bottom = other.bottom # <<<<<<<<<<<<<<
7032 *
7033 * def clip(self, other, y=None, w=None, h=None):
7034 */
7035 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
7036 __Pyx_GOTREF(__pyx_t_3);
7037 if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom, __pyx_t_3) < 0) __PYX_ERR(0, 253, __pyx_L1_error)
7038 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7039
7040 /* "pygame_sdl2/rect.pyx":252
7041 * if self.top < other.top:
7042 * self.top = other.top
7043 * elif self.bottom > other.bottom: # <<<<<<<<<<<<<<
7044 * self.bottom = other.bottom
7045 *
7046 */
7047 }
7048 __pyx_L8:;
7049 }
7050 __pyx_L4:;
7051
7052 /* "pygame_sdl2/rect.pyx":239
7053 * return r
7054 *
7055 * def clamp_ip(self, other): # <<<<<<<<<<<<<<
7056 * if not isinstance(other, Rect):
7057 * other = Rect(other)
7058 */
7059
7060 /* function exit code */
7061 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7062 goto __pyx_L0;
7063 __pyx_L1_error:;
7064 __Pyx_XDECREF(__pyx_t_3);
7065 __Pyx_XDECREF(__pyx_t_4);
7066 __Pyx_XDECREF(__pyx_t_5);
7067 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clamp_ip", __pyx_clineno, __pyx_lineno, __pyx_filename);
7068 __pyx_r = NULL;
7069 __pyx_L0:;
7070 __Pyx_XDECREF(__pyx_v_other);
7071 __Pyx_XGIVEREF(__pyx_r);
7072 __Pyx_RefNannyFinishContext();
7073 return __pyx_r;
7074 }
7075
7076 /* "pygame_sdl2/rect.pyx":255
7077 * self.bottom = other.bottom
7078 *
7079 * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<<
7080 * if type(other) == int:
7081 * other = Rect(other, y, w, h)
7082 */
7083
7084 /* Python wrapper */
7085 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7086 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7087 PyObject *__pyx_v_other = 0;
7088 PyObject *__pyx_v_y = 0;
7089 PyObject *__pyx_v_w = 0;
7090 PyObject *__pyx_v_h = 0;
7091 int __pyx_lineno = 0;
7092 const char *__pyx_filename = NULL;
7093 int __pyx_clineno = 0;
7094 PyObject *__pyx_r = 0;
7095 __Pyx_RefNannyDeclarations
7096 __Pyx_RefNannySetupContext("clip (wrapper)", 0);
7097 {
7098 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_h,0};
7099 PyObject* values[4] = {0,0,0,0};
7100 values[1] = ((PyObject *)Py_None);
7101 values[2] = ((PyObject *)Py_None);
7102 values[3] = ((PyObject *)Py_None);
7103 if (unlikely(__pyx_kwds)) {
7104 Py_ssize_t kw_args;
7105 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7106 switch (pos_args) {
7107 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7108 CYTHON_FALLTHROUGH;
7109 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7110 CYTHON_FALLTHROUGH;
7111 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7112 CYTHON_FALLTHROUGH;
7113 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7114 CYTHON_FALLTHROUGH;
7115 case 0: break;
7116 default: goto __pyx_L5_argtuple_error;
7117 }
7118 kw_args = PyDict_Size(__pyx_kwds);
7119 switch (pos_args) {
7120 case 0:
7121 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
7122 else goto __pyx_L5_argtuple_error;
7123 CYTHON_FALLTHROUGH;
7124 case 1:
7125 if (kw_args > 0) {
7126 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y);
7127 if (value) { values[1] = value; kw_args--; }
7128 }
7129 CYTHON_FALLTHROUGH;
7130 case 2:
7131 if (kw_args > 0) {
7132 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w);
7133 if (value) { values[2] = value; kw_args--; }
7134 }
7135 CYTHON_FALLTHROUGH;
7136 case 3:
7137 if (kw_args > 0) {
7138 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h);
7139 if (value) { values[3] = value; kw_args--; }
7140 }
7141 }
7142 if (unlikely(kw_args > 0)) {
7143 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clip") < 0)) __PYX_ERR(0, 255, __pyx_L3_error)
7144 }
7145 } else {
7146 switch (PyTuple_GET_SIZE(__pyx_args)) {
7147 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7148 CYTHON_FALLTHROUGH;
7149 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7150 CYTHON_FALLTHROUGH;
7151 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7152 CYTHON_FALLTHROUGH;
7153 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7154 break;
7155 default: goto __pyx_L5_argtuple_error;
7156 }
7157 }
7158 __pyx_v_other = values[0];
7159 __pyx_v_y = values[1];
7160 __pyx_v_w = values[2];
7161 __pyx_v_h = values[3];
7162 }
7163 goto __pyx_L4_argument_unpacking_done;
7164 __pyx_L5_argtuple_error:;
7165 __Pyx_RaiseArgtupleInvalid("clip", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 255, __pyx_L3_error)
7166 __pyx_L3_error:;
7167 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clip", __pyx_clineno, __pyx_lineno, __pyx_filename);
7168 __Pyx_RefNannyFinishContext();
7169 return NULL;
7170 __pyx_L4_argument_unpacking_done:;
7171 __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);
7172
7173 /* function exit code */
7174 __Pyx_RefNannyFinishContext();
7175 return __pyx_r;
7176 }
7177
__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)7178 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) {
7179 PyObject *__pyx_v_r = NULL;
7180 PyObject *__pyx_v_d = NULL;
7181 PyObject *__pyx_r = NULL;
7182 __Pyx_RefNannyDeclarations
7183 PyObject *__pyx_t_1 = NULL;
7184 int __pyx_t_2;
7185 PyObject *__pyx_t_3 = NULL;
7186 int __pyx_t_4;
7187 PyObject *__pyx_t_5 = NULL;
7188 int __pyx_lineno = 0;
7189 const char *__pyx_filename = NULL;
7190 int __pyx_clineno = 0;
7191 __Pyx_RefNannySetupContext("clip", 0);
7192 __Pyx_INCREF(__pyx_v_other);
7193
7194 /* "pygame_sdl2/rect.pyx":256
7195 *
7196 * def clip(self, other, y=None, w=None, h=None):
7197 * if type(other) == int: # <<<<<<<<<<<<<<
7198 * other = Rect(other, y, w, h)
7199 *
7200 */
7201 __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_ERR(0, 256, __pyx_L1_error)
7202 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 256, __pyx_L1_error)
7203 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7204 if (__pyx_t_2) {
7205
7206 /* "pygame_sdl2/rect.pyx":257
7207 * def clip(self, other, y=None, w=None, h=None):
7208 * if type(other) == int:
7209 * other = Rect(other, y, w, h) # <<<<<<<<<<<<<<
7210 *
7211 * if not isinstance(other, Rect):
7212 */
7213 __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error)
7214 __Pyx_GOTREF(__pyx_t_1);
7215 __Pyx_INCREF(__pyx_v_other);
7216 __Pyx_GIVEREF(__pyx_v_other);
7217 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_other);
7218 __Pyx_INCREF(__pyx_v_y);
7219 __Pyx_GIVEREF(__pyx_v_y);
7220 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
7221 __Pyx_INCREF(__pyx_v_w);
7222 __Pyx_GIVEREF(__pyx_v_w);
7223 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_w);
7224 __Pyx_INCREF(__pyx_v_h);
7225 __Pyx_GIVEREF(__pyx_v_h);
7226 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_h);
7227 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
7228 __Pyx_GOTREF(__pyx_t_3);
7229 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7230 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
7231 __pyx_t_3 = 0;
7232
7233 /* "pygame_sdl2/rect.pyx":256
7234 *
7235 * def clip(self, other, y=None, w=None, h=None):
7236 * if type(other) == int: # <<<<<<<<<<<<<<
7237 * other = Rect(other, y, w, h)
7238 *
7239 */
7240 }
7241
7242 /* "pygame_sdl2/rect.pyx":259
7243 * other = Rect(other, y, w, h)
7244 *
7245 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
7246 * other = Rect(other)
7247 *
7248 */
7249 __pyx_t_2 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect);
7250 __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7251 if (__pyx_t_4) {
7252
7253 /* "pygame_sdl2/rect.pyx":260
7254 *
7255 * if not isinstance(other, Rect):
7256 * other = Rect(other) # <<<<<<<<<<<<<<
7257 *
7258 * if not self.colliderect(other):
7259 */
7260 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
7261 __Pyx_GOTREF(__pyx_t_3);
7262 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
7263 __pyx_t_3 = 0;
7264
7265 /* "pygame_sdl2/rect.pyx":259
7266 * other = Rect(other, y, w, h)
7267 *
7268 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
7269 * other = Rect(other)
7270 *
7271 */
7272 }
7273
7274 /* "pygame_sdl2/rect.pyx":262
7275 * other = Rect(other)
7276 *
7277 * if not self.colliderect(other): # <<<<<<<<<<<<<<
7278 * return Rect(0,0,0,0)
7279 *
7280 */
7281 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
7282 __Pyx_GOTREF(__pyx_t_1);
7283 __pyx_t_5 = NULL;
7284 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7285 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
7286 if (likely(__pyx_t_5)) {
7287 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7288 __Pyx_INCREF(__pyx_t_5);
7289 __Pyx_INCREF(function);
7290 __Pyx_DECREF_SET(__pyx_t_1, function);
7291 }
7292 }
7293 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_other);
7294 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7295 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error)
7296 __Pyx_GOTREF(__pyx_t_3);
7297 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7298 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 262, __pyx_L1_error)
7299 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7300 __pyx_t_2 = ((!__pyx_t_4) != 0);
7301 if (__pyx_t_2) {
7302
7303 /* "pygame_sdl2/rect.pyx":263
7304 *
7305 * if not self.colliderect(other):
7306 * return Rect(0,0,0,0) # <<<<<<<<<<<<<<
7307 *
7308 * r = self.copy()
7309 */
7310 __Pyx_XDECREF(__pyx_r);
7311 __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
7312 __Pyx_GOTREF(__pyx_t_3);
7313 __pyx_r = __pyx_t_3;
7314 __pyx_t_3 = 0;
7315 goto __pyx_L0;
7316
7317 /* "pygame_sdl2/rect.pyx":262
7318 * other = Rect(other)
7319 *
7320 * if not self.colliderect(other): # <<<<<<<<<<<<<<
7321 * return Rect(0,0,0,0)
7322 *
7323 */
7324 }
7325
7326 /* "pygame_sdl2/rect.pyx":265
7327 * return Rect(0,0,0,0)
7328 *
7329 * r = self.copy() # <<<<<<<<<<<<<<
7330 *
7331 * # Remember that (0,0) is the top left.
7332 */
7333 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
7334 __Pyx_GOTREF(__pyx_t_1);
7335 __pyx_t_5 = NULL;
7336 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
7337 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
7338 if (likely(__pyx_t_5)) {
7339 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
7340 __Pyx_INCREF(__pyx_t_5);
7341 __Pyx_INCREF(function);
7342 __Pyx_DECREF_SET(__pyx_t_1, function);
7343 }
7344 }
7345 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
7346 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
7347 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error)
7348 __Pyx_GOTREF(__pyx_t_3);
7349 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7350 __pyx_v_r = __pyx_t_3;
7351 __pyx_t_3 = 0;
7352
7353 /* "pygame_sdl2/rect.pyx":268
7354 *
7355 * # Remember that (0,0) is the top left.
7356 * if r.left < other.left: # <<<<<<<<<<<<<<
7357 * d = other.left - r.left
7358 * r.left += d
7359 */
7360 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error)
7361 __Pyx_GOTREF(__pyx_t_3);
7362 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 268, __pyx_L1_error)
7363 __Pyx_GOTREF(__pyx_t_1);
7364 __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, 268, __pyx_L1_error)
7365 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7366 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7367 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 268, __pyx_L1_error)
7368 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7369 if (__pyx_t_2) {
7370
7371 /* "pygame_sdl2/rect.pyx":269
7372 * # Remember that (0,0) is the top left.
7373 * if r.left < other.left:
7374 * d = other.left - r.left # <<<<<<<<<<<<<<
7375 * r.left += d
7376 * r.width -= d
7377 */
7378 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
7379 __Pyx_GOTREF(__pyx_t_5);
7380 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 269, __pyx_L1_error)
7381 __Pyx_GOTREF(__pyx_t_1);
7382 __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
7383 __Pyx_GOTREF(__pyx_t_3);
7384 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7385 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7386 __pyx_v_d = __pyx_t_3;
7387 __pyx_t_3 = 0;
7388
7389 /* "pygame_sdl2/rect.pyx":270
7390 * if r.left < other.left:
7391 * d = other.left - r.left
7392 * r.left += d # <<<<<<<<<<<<<<
7393 * r.width -= d
7394 * if r.right > other.right:
7395 */
7396 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_left); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
7397 __Pyx_GOTREF(__pyx_t_3);
7398 __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error)
7399 __Pyx_GOTREF(__pyx_t_1);
7400 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7401 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_left, __pyx_t_1) < 0) __PYX_ERR(0, 270, __pyx_L1_error)
7402 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7403
7404 /* "pygame_sdl2/rect.pyx":271
7405 * d = other.left - r.left
7406 * r.left += d
7407 * r.width -= d # <<<<<<<<<<<<<<
7408 * if r.right > other.right:
7409 * d = r.right - other.right
7410 */
7411 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error)
7412 __Pyx_GOTREF(__pyx_t_1);
7413 __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error)
7414 __Pyx_GOTREF(__pyx_t_3);
7415 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7416 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_3) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
7417 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7418
7419 /* "pygame_sdl2/rect.pyx":268
7420 *
7421 * # Remember that (0,0) is the top left.
7422 * if r.left < other.left: # <<<<<<<<<<<<<<
7423 * d = other.left - r.left
7424 * r.left += d
7425 */
7426 }
7427
7428 /* "pygame_sdl2/rect.pyx":272
7429 * r.left += d
7430 * r.width -= d
7431 * if r.right > other.right: # <<<<<<<<<<<<<<
7432 * d = r.right - other.right
7433 * r.width -=d
7434 */
7435 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
7436 __Pyx_GOTREF(__pyx_t_3);
7437 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
7438 __Pyx_GOTREF(__pyx_t_1);
7439 __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, 272, __pyx_L1_error)
7440 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7441 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7442 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 272, __pyx_L1_error)
7443 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7444 if (__pyx_t_2) {
7445
7446 /* "pygame_sdl2/rect.pyx":273
7447 * r.width -= d
7448 * if r.right > other.right:
7449 * d = r.right - other.right # <<<<<<<<<<<<<<
7450 * r.width -=d
7451 * if r.top < other.top:
7452 */
7453 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
7454 __Pyx_GOTREF(__pyx_t_5);
7455 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error)
7456 __Pyx_GOTREF(__pyx_t_1);
7457 __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error)
7458 __Pyx_GOTREF(__pyx_t_3);
7459 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7460 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7461 __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_3);
7462 __pyx_t_3 = 0;
7463
7464 /* "pygame_sdl2/rect.pyx":274
7465 * if r.right > other.right:
7466 * d = r.right - other.right
7467 * r.width -=d # <<<<<<<<<<<<<<
7468 * if r.top < other.top:
7469 * d = other.top - r.top
7470 */
7471 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_width); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error)
7472 __Pyx_GOTREF(__pyx_t_3);
7473 __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
7474 __Pyx_GOTREF(__pyx_t_1);
7475 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7476 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_width, __pyx_t_1) < 0) __PYX_ERR(0, 274, __pyx_L1_error)
7477 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7478
7479 /* "pygame_sdl2/rect.pyx":272
7480 * r.left += d
7481 * r.width -= d
7482 * if r.right > other.right: # <<<<<<<<<<<<<<
7483 * d = r.right - other.right
7484 * r.width -=d
7485 */
7486 }
7487
7488 /* "pygame_sdl2/rect.pyx":275
7489 * d = r.right - other.right
7490 * r.width -=d
7491 * if r.top < other.top: # <<<<<<<<<<<<<<
7492 * d = other.top - r.top
7493 * r.top += d
7494 */
7495 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error)
7496 __Pyx_GOTREF(__pyx_t_1);
7497 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
7498 __Pyx_GOTREF(__pyx_t_3);
7499 __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 275, __pyx_L1_error)
7500 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7501 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7502 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
7503 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7504 if (__pyx_t_2) {
7505
7506 /* "pygame_sdl2/rect.pyx":276
7507 * r.width -=d
7508 * if r.top < other.top:
7509 * d = other.top - r.top # <<<<<<<<<<<<<<
7510 * r.top += d
7511 * r.height -= d
7512 */
7513 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
7514 __Pyx_GOTREF(__pyx_t_5);
7515 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error)
7516 __Pyx_GOTREF(__pyx_t_3);
7517 __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error)
7518 __Pyx_GOTREF(__pyx_t_1);
7519 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7520 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7521 __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1);
7522 __pyx_t_1 = 0;
7523
7524 /* "pygame_sdl2/rect.pyx":277
7525 * if r.top < other.top:
7526 * d = other.top - r.top
7527 * r.top += d # <<<<<<<<<<<<<<
7528 * r.height -= d
7529 * if r.bottom > other.bottom:
7530 */
7531 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_top); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
7532 __Pyx_GOTREF(__pyx_t_1);
7533 __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
7534 __Pyx_GOTREF(__pyx_t_3);
7535 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7536 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_top, __pyx_t_3) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
7537 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7538
7539 /* "pygame_sdl2/rect.pyx":278
7540 * d = other.top - r.top
7541 * r.top += d
7542 * r.height -= d # <<<<<<<<<<<<<<
7543 * if r.bottom > other.bottom:
7544 * d = r.bottom - other.bottom
7545 */
7546 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error)
7547 __Pyx_GOTREF(__pyx_t_3);
7548 __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_3, __pyx_v_d); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error)
7549 __Pyx_GOTREF(__pyx_t_1);
7550 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7551 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_1) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
7552 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7553
7554 /* "pygame_sdl2/rect.pyx":275
7555 * d = r.right - other.right
7556 * r.width -=d
7557 * if r.top < other.top: # <<<<<<<<<<<<<<
7558 * d = other.top - r.top
7559 * r.top += d
7560 */
7561 }
7562
7563 /* "pygame_sdl2/rect.pyx":279
7564 * r.top += d
7565 * r.height -= d
7566 * if r.bottom > other.bottom: # <<<<<<<<<<<<<<
7567 * d = r.bottom - other.bottom
7568 * r.height -= d
7569 */
7570 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 279, __pyx_L1_error)
7571 __Pyx_GOTREF(__pyx_t_1);
7572 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error)
7573 __Pyx_GOTREF(__pyx_t_3);
7574 __pyx_t_5 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
7575 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7576 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7577 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
7578 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7579 if (__pyx_t_2) {
7580
7581 /* "pygame_sdl2/rect.pyx":280
7582 * r.height -= d
7583 * if r.bottom > other.bottom:
7584 * d = r.bottom - other.bottom # <<<<<<<<<<<<<<
7585 * r.height -= d
7586 *
7587 */
7588 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 280, __pyx_L1_error)
7589 __Pyx_GOTREF(__pyx_t_5);
7590 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
7591 __Pyx_GOTREF(__pyx_t_3);
7592 __pyx_t_1 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 280, __pyx_L1_error)
7593 __Pyx_GOTREF(__pyx_t_1);
7594 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7595 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7596 __Pyx_XDECREF_SET(__pyx_v_d, __pyx_t_1);
7597 __pyx_t_1 = 0;
7598
7599 /* "pygame_sdl2/rect.pyx":281
7600 * if r.bottom > other.bottom:
7601 * d = r.bottom - other.bottom
7602 * r.height -= d # <<<<<<<<<<<<<<
7603 *
7604 * return r
7605 */
7606 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
7607 __Pyx_GOTREF(__pyx_t_1);
7608 __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_v_d); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 281, __pyx_L1_error)
7609 __Pyx_GOTREF(__pyx_t_3);
7610 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7611 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_height, __pyx_t_3) < 0) __PYX_ERR(0, 281, __pyx_L1_error)
7612 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7613
7614 /* "pygame_sdl2/rect.pyx":279
7615 * r.top += d
7616 * r.height -= d
7617 * if r.bottom > other.bottom: # <<<<<<<<<<<<<<
7618 * d = r.bottom - other.bottom
7619 * r.height -= d
7620 */
7621 }
7622
7623 /* "pygame_sdl2/rect.pyx":283
7624 * r.height -= d
7625 *
7626 * return r # <<<<<<<<<<<<<<
7627 *
7628 * def union(self, other):
7629 */
7630 __Pyx_XDECREF(__pyx_r);
7631 __Pyx_INCREF(__pyx_v_r);
7632 __pyx_r = __pyx_v_r;
7633 goto __pyx_L0;
7634
7635 /* "pygame_sdl2/rect.pyx":255
7636 * self.bottom = other.bottom
7637 *
7638 * def clip(self, other, y=None, w=None, h=None): # <<<<<<<<<<<<<<
7639 * if type(other) == int:
7640 * other = Rect(other, y, w, h)
7641 */
7642
7643 /* function exit code */
7644 __pyx_L1_error:;
7645 __Pyx_XDECREF(__pyx_t_1);
7646 __Pyx_XDECREF(__pyx_t_3);
7647 __Pyx_XDECREF(__pyx_t_5);
7648 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.clip", __pyx_clineno, __pyx_lineno, __pyx_filename);
7649 __pyx_r = NULL;
7650 __pyx_L0:;
7651 __Pyx_XDECREF(__pyx_v_r);
7652 __Pyx_XDECREF(__pyx_v_d);
7653 __Pyx_XDECREF(__pyx_v_other);
7654 __Pyx_XGIVEREF(__pyx_r);
7655 __Pyx_RefNannyFinishContext();
7656 return __pyx_r;
7657 }
7658
7659 /* "pygame_sdl2/rect.pyx":285
7660 * return r
7661 *
7662 * def union(self, other): # <<<<<<<<<<<<<<
7663 * r = self.copy()
7664 * r.union_ip(other)
7665 */
7666
7667 /* Python wrapper */
7668 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject * __pyx_v_self,PyObject * __pyx_v_other)7669 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_33union(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
7670 PyObject *__pyx_r = 0;
7671 __Pyx_RefNannyDeclarations
7672 __Pyx_RefNannySetupContext("union (wrapper)", 0);
7673 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_32union(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other));
7674
7675 /* function exit code */
7676 __Pyx_RefNannyFinishContext();
7677 return __pyx_r;
7678 }
7679
__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other)7680 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_32union(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) {
7681 PyObject *__pyx_v_r = NULL;
7682 PyObject *__pyx_r = NULL;
7683 __Pyx_RefNannyDeclarations
7684 PyObject *__pyx_t_1 = NULL;
7685 PyObject *__pyx_t_2 = NULL;
7686 PyObject *__pyx_t_3 = NULL;
7687 int __pyx_lineno = 0;
7688 const char *__pyx_filename = NULL;
7689 int __pyx_clineno = 0;
7690 __Pyx_RefNannySetupContext("union", 0);
7691
7692 /* "pygame_sdl2/rect.pyx":286
7693 *
7694 * def union(self, other):
7695 * r = self.copy() # <<<<<<<<<<<<<<
7696 * r.union_ip(other)
7697 * return r
7698 */
7699 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
7700 __Pyx_GOTREF(__pyx_t_2);
7701 __pyx_t_3 = NULL;
7702 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7703 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7704 if (likely(__pyx_t_3)) {
7705 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7706 __Pyx_INCREF(__pyx_t_3);
7707 __Pyx_INCREF(function);
7708 __Pyx_DECREF_SET(__pyx_t_2, function);
7709 }
7710 }
7711 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
7712 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7713 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
7714 __Pyx_GOTREF(__pyx_t_1);
7715 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7716 __pyx_v_r = __pyx_t_1;
7717 __pyx_t_1 = 0;
7718
7719 /* "pygame_sdl2/rect.pyx":287
7720 * def union(self, other):
7721 * r = self.copy()
7722 * r.union_ip(other) # <<<<<<<<<<<<<<
7723 * return r
7724 *
7725 */
7726 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_union_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error)
7727 __Pyx_GOTREF(__pyx_t_2);
7728 __pyx_t_3 = NULL;
7729 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7730 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7731 if (likely(__pyx_t_3)) {
7732 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7733 __Pyx_INCREF(__pyx_t_3);
7734 __Pyx_INCREF(function);
7735 __Pyx_DECREF_SET(__pyx_t_2, function);
7736 }
7737 }
7738 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other);
7739 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7740 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
7741 __Pyx_GOTREF(__pyx_t_1);
7742 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7743 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7744
7745 /* "pygame_sdl2/rect.pyx":288
7746 * r = self.copy()
7747 * r.union_ip(other)
7748 * return r # <<<<<<<<<<<<<<
7749 *
7750 * def union_ip(self, other):
7751 */
7752 __Pyx_XDECREF(__pyx_r);
7753 __Pyx_INCREF(__pyx_v_r);
7754 __pyx_r = __pyx_v_r;
7755 goto __pyx_L0;
7756
7757 /* "pygame_sdl2/rect.pyx":285
7758 * return r
7759 *
7760 * def union(self, other): # <<<<<<<<<<<<<<
7761 * r = self.copy()
7762 * r.union_ip(other)
7763 */
7764
7765 /* function exit code */
7766 __pyx_L1_error:;
7767 __Pyx_XDECREF(__pyx_t_1);
7768 __Pyx_XDECREF(__pyx_t_2);
7769 __Pyx_XDECREF(__pyx_t_3);
7770 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union", __pyx_clineno, __pyx_lineno, __pyx_filename);
7771 __pyx_r = NULL;
7772 __pyx_L0:;
7773 __Pyx_XDECREF(__pyx_v_r);
7774 __Pyx_XGIVEREF(__pyx_r);
7775 __Pyx_RefNannyFinishContext();
7776 return __pyx_r;
7777 }
7778
7779 /* "pygame_sdl2/rect.pyx":290
7780 * return r
7781 *
7782 * def union_ip(self, other): # <<<<<<<<<<<<<<
7783 * if not isinstance(other, Rect):
7784 * other = Rect(other)
7785 */
7786
7787 /* Python wrapper */
7788 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject * __pyx_v_self,PyObject * __pyx_v_other)7789 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
7790 PyObject *__pyx_r = 0;
7791 __Pyx_RefNannyDeclarations
7792 __Pyx_RefNannySetupContext("union_ip (wrapper)", 0);
7793 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other));
7794
7795 /* function exit code */
7796 __Pyx_RefNannyFinishContext();
7797 return __pyx_r;
7798 }
7799
__pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other)7800 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_34union_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) {
7801 PyObject *__pyx_v_x = NULL;
7802 PyObject *__pyx_v_y = NULL;
7803 PyObject *__pyx_r = NULL;
7804 __Pyx_RefNannyDeclarations
7805 int __pyx_t_1;
7806 int __pyx_t_2;
7807 PyObject *__pyx_t_3 = NULL;
7808 int __pyx_t_4;
7809 PyObject *__pyx_t_5 = NULL;
7810 PyObject *__pyx_t_6 = NULL;
7811 PyObject *__pyx_t_7 = NULL;
7812 int __pyx_lineno = 0;
7813 const char *__pyx_filename = NULL;
7814 int __pyx_clineno = 0;
7815 __Pyx_RefNannySetupContext("union_ip", 0);
7816 __Pyx_INCREF(__pyx_v_other);
7817
7818 /* "pygame_sdl2/rect.pyx":291
7819 *
7820 * def union_ip(self, other):
7821 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
7822 * other = Rect(other)
7823 *
7824 */
7825 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect);
7826 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
7827 if (__pyx_t_2) {
7828
7829 /* "pygame_sdl2/rect.pyx":292
7830 * def union_ip(self, other):
7831 * if not isinstance(other, Rect):
7832 * other = Rect(other) # <<<<<<<<<<<<<<
7833 *
7834 * x = min(self.x, other.x)
7835 */
7836 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 292, __pyx_L1_error)
7837 __Pyx_GOTREF(__pyx_t_3);
7838 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
7839 __pyx_t_3 = 0;
7840
7841 /* "pygame_sdl2/rect.pyx":291
7842 *
7843 * def union_ip(self, other):
7844 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
7845 * other = Rect(other)
7846 *
7847 */
7848 }
7849
7850 /* "pygame_sdl2/rect.pyx":294
7851 * other = Rect(other)
7852 *
7853 * x = min(self.x, other.x) # <<<<<<<<<<<<<<
7854 * y = min(self.y, other.y)
7855 * self.w = max(self.right, other.right) - x
7856 */
7857 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error)
7858 __Pyx_GOTREF(__pyx_t_3);
7859 __pyx_t_4 = __pyx_v_self->x;
7860 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 294, __pyx_L1_error)
7861 __Pyx_GOTREF(__pyx_t_6);
7862 __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
7863 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7864 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 294, __pyx_L1_error)
7865 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7866 if (__pyx_t_2) {
7867 __Pyx_INCREF(__pyx_t_3);
7868 __pyx_t_5 = __pyx_t_3;
7869 } else {
7870 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 294, __pyx_L1_error)
7871 __Pyx_GOTREF(__pyx_t_7);
7872 __pyx_t_5 = __pyx_t_7;
7873 __pyx_t_7 = 0;
7874 }
7875 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7876 __pyx_t_3 = __pyx_t_5;
7877 __Pyx_INCREF(__pyx_t_3);
7878 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7879 __pyx_v_x = __pyx_t_3;
7880 __pyx_t_3 = 0;
7881
7882 /* "pygame_sdl2/rect.pyx":295
7883 *
7884 * x = min(self.x, other.x)
7885 * y = min(self.y, other.y) # <<<<<<<<<<<<<<
7886 * self.w = max(self.right, other.right) - x
7887 * self.h = max(self.bottom, other.bottom) - y
7888 */
7889 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
7890 __Pyx_GOTREF(__pyx_t_3);
7891 __pyx_t_4 = __pyx_v_self->y;
7892 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error)
7893 __Pyx_GOTREF(__pyx_t_7);
7894 __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_7, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error)
7895 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7896 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
7897 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7898 if (__pyx_t_2) {
7899 __Pyx_INCREF(__pyx_t_3);
7900 __pyx_t_5 = __pyx_t_3;
7901 } else {
7902 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error)
7903 __Pyx_GOTREF(__pyx_t_6);
7904 __pyx_t_5 = __pyx_t_6;
7905 __pyx_t_6 = 0;
7906 }
7907 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7908 __pyx_t_3 = __pyx_t_5;
7909 __Pyx_INCREF(__pyx_t_3);
7910 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7911 __pyx_v_y = __pyx_t_3;
7912 __pyx_t_3 = 0;
7913
7914 /* "pygame_sdl2/rect.pyx":296
7915 * x = min(self.x, other.x)
7916 * y = min(self.y, other.y)
7917 * self.w = max(self.right, other.right) - x # <<<<<<<<<<<<<<
7918 * self.h = max(self.bottom, other.bottom) - y
7919 * self.x = x
7920 */
7921 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
7922 __Pyx_GOTREF(__pyx_t_3);
7923 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
7924 __Pyx_GOTREF(__pyx_t_5);
7925 __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 296, __pyx_L1_error)
7926 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
7927 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7928 if (__pyx_t_2) {
7929 __Pyx_INCREF(__pyx_t_3);
7930 __pyx_t_6 = __pyx_t_3;
7931 } else {
7932 __Pyx_INCREF(__pyx_t_5);
7933 __pyx_t_6 = __pyx_t_5;
7934 }
7935 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7936 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7937 __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
7938 __Pyx_GOTREF(__pyx_t_3);
7939 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7940 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 296, __pyx_L1_error)
7941 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7942 __pyx_v_self->w = __pyx_t_4;
7943
7944 /* "pygame_sdl2/rect.pyx":297
7945 * y = min(self.y, other.y)
7946 * self.w = max(self.right, other.right) - x
7947 * self.h = max(self.bottom, other.bottom) - y # <<<<<<<<<<<<<<
7948 * self.x = x
7949 * self.y = y
7950 */
7951 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
7952 __Pyx_GOTREF(__pyx_t_3);
7953 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error)
7954 __Pyx_GOTREF(__pyx_t_6);
7955 __pyx_t_7 = PyObject_RichCompare(__pyx_t_3, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error)
7956 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 297, __pyx_L1_error)
7957 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7958 if (__pyx_t_2) {
7959 __Pyx_INCREF(__pyx_t_3);
7960 __pyx_t_5 = __pyx_t_3;
7961 } else {
7962 __Pyx_INCREF(__pyx_t_6);
7963 __pyx_t_5 = __pyx_t_6;
7964 }
7965 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7966 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7967 __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error)
7968 __Pyx_GOTREF(__pyx_t_3);
7969 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7970 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
7971 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7972 __pyx_v_self->h = __pyx_t_4;
7973
7974 /* "pygame_sdl2/rect.pyx":298
7975 * self.w = max(self.right, other.right) - x
7976 * self.h = max(self.bottom, other.bottom) - y
7977 * self.x = x # <<<<<<<<<<<<<<
7978 * self.y = y
7979 *
7980 */
7981 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_x); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 298, __pyx_L1_error)
7982 __pyx_v_self->x = __pyx_t_4;
7983
7984 /* "pygame_sdl2/rect.pyx":299
7985 * self.h = max(self.bottom, other.bottom) - y
7986 * self.x = x
7987 * self.y = y # <<<<<<<<<<<<<<
7988 *
7989 * def unionall(self, other_seq):
7990 */
7991 __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_y); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 299, __pyx_L1_error)
7992 __pyx_v_self->y = __pyx_t_4;
7993
7994 /* "pygame_sdl2/rect.pyx":290
7995 * return r
7996 *
7997 * def union_ip(self, other): # <<<<<<<<<<<<<<
7998 * if not isinstance(other, Rect):
7999 * other = Rect(other)
8000 */
8001
8002 /* function exit code */
8003 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8004 goto __pyx_L0;
8005 __pyx_L1_error:;
8006 __Pyx_XDECREF(__pyx_t_3);
8007 __Pyx_XDECREF(__pyx_t_5);
8008 __Pyx_XDECREF(__pyx_t_6);
8009 __Pyx_XDECREF(__pyx_t_7);
8010 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.union_ip", __pyx_clineno, __pyx_lineno, __pyx_filename);
8011 __pyx_r = NULL;
8012 __pyx_L0:;
8013 __Pyx_XDECREF(__pyx_v_x);
8014 __Pyx_XDECREF(__pyx_v_y);
8015 __Pyx_XDECREF(__pyx_v_other);
8016 __Pyx_XGIVEREF(__pyx_r);
8017 __Pyx_RefNannyFinishContext();
8018 return __pyx_r;
8019 }
8020
8021 /* "pygame_sdl2/rect.pyx":301
8022 * self.y = y
8023 *
8024 * def unionall(self, other_seq): # <<<<<<<<<<<<<<
8025 * r = self.copy()
8026 * r.unionall_ip(other_seq)
8027 */
8028
8029 /* Python wrapper */
8030 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject * __pyx_v_self,PyObject * __pyx_v_other_seq)8031 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq) {
8032 PyObject *__pyx_r = 0;
8033 __Pyx_RefNannyDeclarations
8034 __Pyx_RefNannySetupContext("unionall (wrapper)", 0);
8035 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_seq));
8036
8037 /* function exit code */
8038 __Pyx_RefNannyFinishContext();
8039 return __pyx_r;
8040 }
8041
__pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other_seq)8042 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_36unionall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_seq) {
8043 PyObject *__pyx_v_r = NULL;
8044 PyObject *__pyx_r = NULL;
8045 __Pyx_RefNannyDeclarations
8046 PyObject *__pyx_t_1 = NULL;
8047 PyObject *__pyx_t_2 = NULL;
8048 PyObject *__pyx_t_3 = NULL;
8049 int __pyx_lineno = 0;
8050 const char *__pyx_filename = NULL;
8051 int __pyx_clineno = 0;
8052 __Pyx_RefNannySetupContext("unionall", 0);
8053
8054 /* "pygame_sdl2/rect.pyx":302
8055 *
8056 * def unionall(self, other_seq):
8057 * r = self.copy() # <<<<<<<<<<<<<<
8058 * r.unionall_ip(other_seq)
8059 * return r
8060 */
8061 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
8062 __Pyx_GOTREF(__pyx_t_2);
8063 __pyx_t_3 = NULL;
8064 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
8065 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
8066 if (likely(__pyx_t_3)) {
8067 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
8068 __Pyx_INCREF(__pyx_t_3);
8069 __Pyx_INCREF(function);
8070 __Pyx_DECREF_SET(__pyx_t_2, function);
8071 }
8072 }
8073 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
8074 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8075 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
8076 __Pyx_GOTREF(__pyx_t_1);
8077 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8078 __pyx_v_r = __pyx_t_1;
8079 __pyx_t_1 = 0;
8080
8081 /* "pygame_sdl2/rect.pyx":303
8082 * def unionall(self, other_seq):
8083 * r = self.copy()
8084 * r.unionall_ip(other_seq) # <<<<<<<<<<<<<<
8085 * return r
8086 *
8087 */
8088 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_unionall_ip); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error)
8089 __Pyx_GOTREF(__pyx_t_2);
8090 __pyx_t_3 = NULL;
8091 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
8092 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
8093 if (likely(__pyx_t_3)) {
8094 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
8095 __Pyx_INCREF(__pyx_t_3);
8096 __Pyx_INCREF(function);
8097 __Pyx_DECREF_SET(__pyx_t_2, function);
8098 }
8099 }
8100 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_other_seq) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_other_seq);
8101 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8102 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
8103 __Pyx_GOTREF(__pyx_t_1);
8104 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8105 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8106
8107 /* "pygame_sdl2/rect.pyx":304
8108 * r = self.copy()
8109 * r.unionall_ip(other_seq)
8110 * return r # <<<<<<<<<<<<<<
8111 *
8112 * def unionall_ip(self, other_seq):
8113 */
8114 __Pyx_XDECREF(__pyx_r);
8115 __Pyx_INCREF(__pyx_v_r);
8116 __pyx_r = __pyx_v_r;
8117 goto __pyx_L0;
8118
8119 /* "pygame_sdl2/rect.pyx":301
8120 * self.y = y
8121 *
8122 * def unionall(self, other_seq): # <<<<<<<<<<<<<<
8123 * r = self.copy()
8124 * r.unionall_ip(other_seq)
8125 */
8126
8127 /* function exit code */
8128 __pyx_L1_error:;
8129 __Pyx_XDECREF(__pyx_t_1);
8130 __Pyx_XDECREF(__pyx_t_2);
8131 __Pyx_XDECREF(__pyx_t_3);
8132 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall", __pyx_clineno, __pyx_lineno, __pyx_filename);
8133 __pyx_r = NULL;
8134 __pyx_L0:;
8135 __Pyx_XDECREF(__pyx_v_r);
8136 __Pyx_XGIVEREF(__pyx_r);
8137 __Pyx_RefNannyFinishContext();
8138 return __pyx_r;
8139 }
8140
8141 /* "pygame_sdl2/rect.pyx":306
8142 * return r
8143 *
8144 * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<<
8145 * for other in other_seq:
8146 * self.union_ip(other)
8147 */
8148
8149 /* Python wrapper */
8150 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject * __pyx_v_self,PyObject * __pyx_v_other_seq)8151 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip(PyObject *__pyx_v_self, PyObject *__pyx_v_other_seq) {
8152 PyObject *__pyx_r = 0;
8153 __Pyx_RefNannyDeclarations
8154 __Pyx_RefNannySetupContext("unionall_ip (wrapper)", 0);
8155 __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));
8156
8157 /* function exit code */
8158 __Pyx_RefNannyFinishContext();
8159 return __pyx_r;
8160 }
8161
__pyx_pf_11pygame_sdl2_4rect_4Rect_38unionall_ip(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other_seq)8162 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) {
8163 PyObject *__pyx_v_other = NULL;
8164 PyObject *__pyx_r = NULL;
8165 __Pyx_RefNannyDeclarations
8166 PyObject *__pyx_t_1 = NULL;
8167 Py_ssize_t __pyx_t_2;
8168 PyObject *(*__pyx_t_3)(PyObject *);
8169 PyObject *__pyx_t_4 = NULL;
8170 PyObject *__pyx_t_5 = NULL;
8171 PyObject *__pyx_t_6 = NULL;
8172 int __pyx_lineno = 0;
8173 const char *__pyx_filename = NULL;
8174 int __pyx_clineno = 0;
8175 __Pyx_RefNannySetupContext("unionall_ip", 0);
8176
8177 /* "pygame_sdl2/rect.pyx":307
8178 *
8179 * def unionall_ip(self, other_seq):
8180 * for other in other_seq: # <<<<<<<<<<<<<<
8181 * self.union_ip(other)
8182 *
8183 */
8184 if (likely(PyList_CheckExact(__pyx_v_other_seq)) || PyTuple_CheckExact(__pyx_v_other_seq)) {
8185 __pyx_t_1 = __pyx_v_other_seq; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
8186 __pyx_t_3 = NULL;
8187 } else {
8188 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_other_seq); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
8189 __Pyx_GOTREF(__pyx_t_1);
8190 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 307, __pyx_L1_error)
8191 }
8192 for (;;) {
8193 if (likely(!__pyx_t_3)) {
8194 if (likely(PyList_CheckExact(__pyx_t_1))) {
8195 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
8196 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8197 __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, 307, __pyx_L1_error)
8198 #else
8199 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
8200 __Pyx_GOTREF(__pyx_t_4);
8201 #endif
8202 } else {
8203 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
8204 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8205 __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, 307, __pyx_L1_error)
8206 #else
8207 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
8208 __Pyx_GOTREF(__pyx_t_4);
8209 #endif
8210 }
8211 } else {
8212 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
8213 if (unlikely(!__pyx_t_4)) {
8214 PyObject* exc_type = PyErr_Occurred();
8215 if (exc_type) {
8216 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8217 else __PYX_ERR(0, 307, __pyx_L1_error)
8218 }
8219 break;
8220 }
8221 __Pyx_GOTREF(__pyx_t_4);
8222 }
8223 __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_4);
8224 __pyx_t_4 = 0;
8225
8226 /* "pygame_sdl2/rect.pyx":308
8227 * def unionall_ip(self, other_seq):
8228 * for other in other_seq:
8229 * self.union_ip(other) # <<<<<<<<<<<<<<
8230 *
8231 * def fit(self, other):
8232 */
8233 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_union_ip); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 308, __pyx_L1_error)
8234 __Pyx_GOTREF(__pyx_t_5);
8235 __pyx_t_6 = NULL;
8236 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8237 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8238 if (likely(__pyx_t_6)) {
8239 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8240 __Pyx_INCREF(__pyx_t_6);
8241 __Pyx_INCREF(function);
8242 __Pyx_DECREF_SET(__pyx_t_5, function);
8243 }
8244 }
8245 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_other);
8246 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8247 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
8248 __Pyx_GOTREF(__pyx_t_4);
8249 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8250 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8251
8252 /* "pygame_sdl2/rect.pyx":307
8253 *
8254 * def unionall_ip(self, other_seq):
8255 * for other in other_seq: # <<<<<<<<<<<<<<
8256 * self.union_ip(other)
8257 *
8258 */
8259 }
8260 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8261
8262 /* "pygame_sdl2/rect.pyx":306
8263 * return r
8264 *
8265 * def unionall_ip(self, other_seq): # <<<<<<<<<<<<<<
8266 * for other in other_seq:
8267 * self.union_ip(other)
8268 */
8269
8270 /* function exit code */
8271 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8272 goto __pyx_L0;
8273 __pyx_L1_error:;
8274 __Pyx_XDECREF(__pyx_t_1);
8275 __Pyx_XDECREF(__pyx_t_4);
8276 __Pyx_XDECREF(__pyx_t_5);
8277 __Pyx_XDECREF(__pyx_t_6);
8278 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.unionall_ip", __pyx_clineno, __pyx_lineno, __pyx_filename);
8279 __pyx_r = NULL;
8280 __pyx_L0:;
8281 __Pyx_XDECREF(__pyx_v_other);
8282 __Pyx_XGIVEREF(__pyx_r);
8283 __Pyx_RefNannyFinishContext();
8284 return __pyx_r;
8285 }
8286
8287 /* "pygame_sdl2/rect.pyx":310
8288 * self.union_ip(other)
8289 *
8290 * def fit(self, other): # <<<<<<<<<<<<<<
8291 * if not isinstance(other, Rect):
8292 * other = Rect(other)
8293 */
8294
8295 /* Python wrapper */
8296 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject * __pyx_v_self,PyObject * __pyx_v_other)8297 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
8298 PyObject *__pyx_r = 0;
8299 __Pyx_RefNannyDeclarations
8300 __Pyx_RefNannySetupContext("fit (wrapper)", 0);
8301 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other));
8302
8303 /* function exit code */
8304 __Pyx_RefNannyFinishContext();
8305 return __pyx_r;
8306 }
8307
__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other)8308 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_40fit(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) {
8309 PyObject *__pyx_v_r = NULL;
8310 PyObject *__pyx_v_w_ratio = NULL;
8311 PyObject *__pyx_v_h_ratio = NULL;
8312 PyObject *__pyx_v_factor = NULL;
8313 PyObject *__pyx_r = NULL;
8314 __Pyx_RefNannyDeclarations
8315 int __pyx_t_1;
8316 int __pyx_t_2;
8317 PyObject *__pyx_t_3 = NULL;
8318 PyObject *__pyx_t_4 = NULL;
8319 PyObject *__pyx_t_5 = NULL;
8320 PyObject *__pyx_t_6 = NULL;
8321 int __pyx_lineno = 0;
8322 const char *__pyx_filename = NULL;
8323 int __pyx_clineno = 0;
8324 __Pyx_RefNannySetupContext("fit", 0);
8325 __Pyx_INCREF(__pyx_v_other);
8326
8327 /* "pygame_sdl2/rect.pyx":311
8328 *
8329 * def fit(self, other):
8330 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
8331 * other = Rect(other)
8332 *
8333 */
8334 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect);
8335 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
8336 if (__pyx_t_2) {
8337
8338 /* "pygame_sdl2/rect.pyx":312
8339 * def fit(self, other):
8340 * if not isinstance(other, Rect):
8341 * other = Rect(other) # <<<<<<<<<<<<<<
8342 *
8343 * # Not sure if this is entirely correct. Docs and tests are ambiguous.
8344 */
8345 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
8346 __Pyx_GOTREF(__pyx_t_3);
8347 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
8348 __pyx_t_3 = 0;
8349
8350 /* "pygame_sdl2/rect.pyx":311
8351 *
8352 * def fit(self, other):
8353 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
8354 * other = Rect(other)
8355 *
8356 */
8357 }
8358
8359 /* "pygame_sdl2/rect.pyx":315
8360 *
8361 * # Not sure if this is entirely correct. Docs and tests are ambiguous.
8362 * r = self.copy() # <<<<<<<<<<<<<<
8363 * r.topleft = other.topleft
8364 * w_ratio = other.w / float(r.w)
8365 */
8366 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
8367 __Pyx_GOTREF(__pyx_t_4);
8368 __pyx_t_5 = NULL;
8369 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
8370 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
8371 if (likely(__pyx_t_5)) {
8372 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8373 __Pyx_INCREF(__pyx_t_5);
8374 __Pyx_INCREF(function);
8375 __Pyx_DECREF_SET(__pyx_t_4, function);
8376 }
8377 }
8378 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
8379 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
8380 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 315, __pyx_L1_error)
8381 __Pyx_GOTREF(__pyx_t_3);
8382 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8383 __pyx_v_r = __pyx_t_3;
8384 __pyx_t_3 = 0;
8385
8386 /* "pygame_sdl2/rect.pyx":316
8387 * # Not sure if this is entirely correct. Docs and tests are ambiguous.
8388 * r = self.copy()
8389 * r.topleft = other.topleft # <<<<<<<<<<<<<<
8390 * w_ratio = other.w / float(r.w)
8391 * h_ratio = other.h / float(r.h)
8392 */
8393 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_topleft); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error)
8394 __Pyx_GOTREF(__pyx_t_3);
8395 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_topleft, __pyx_t_3) < 0) __PYX_ERR(0, 316, __pyx_L1_error)
8396 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8397
8398 /* "pygame_sdl2/rect.pyx":317
8399 * r = self.copy()
8400 * r.topleft = other.topleft
8401 * w_ratio = other.w / float(r.w) # <<<<<<<<<<<<<<
8402 * h_ratio = other.h / float(r.h)
8403 * factor = min(w_ratio, h_ratio)
8404 */
8405 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_w); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 317, __pyx_L1_error)
8406 __Pyx_GOTREF(__pyx_t_3);
8407 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
8408 __Pyx_GOTREF(__pyx_t_4);
8409 __pyx_t_5 = __Pyx_PyNumber_Float(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 317, __pyx_L1_error)
8410 __Pyx_GOTREF(__pyx_t_5);
8411 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8412 __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
8413 __Pyx_GOTREF(__pyx_t_4);
8414 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8415 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8416 __pyx_v_w_ratio = __pyx_t_4;
8417 __pyx_t_4 = 0;
8418
8419 /* "pygame_sdl2/rect.pyx":318
8420 * r.topleft = other.topleft
8421 * w_ratio = other.w / float(r.w)
8422 * h_ratio = other.h / float(r.h) # <<<<<<<<<<<<<<
8423 * factor = min(w_ratio, h_ratio)
8424 * r.w *= factor
8425 */
8426 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
8427 __Pyx_GOTREF(__pyx_t_4);
8428 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
8429 __Pyx_GOTREF(__pyx_t_5);
8430 __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 318, __pyx_L1_error)
8431 __Pyx_GOTREF(__pyx_t_3);
8432 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8433 __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error)
8434 __Pyx_GOTREF(__pyx_t_5);
8435 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8436 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8437 __pyx_v_h_ratio = __pyx_t_5;
8438 __pyx_t_5 = 0;
8439
8440 /* "pygame_sdl2/rect.pyx":319
8441 * w_ratio = other.w / float(r.w)
8442 * h_ratio = other.h / float(r.h)
8443 * factor = min(w_ratio, h_ratio) # <<<<<<<<<<<<<<
8444 * r.w *= factor
8445 * r.h *= factor
8446 */
8447 __Pyx_INCREF(__pyx_v_h_ratio);
8448 __pyx_t_5 = __pyx_v_h_ratio;
8449 __Pyx_INCREF(__pyx_v_w_ratio);
8450 __pyx_t_3 = __pyx_v_w_ratio;
8451 __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 319, __pyx_L1_error)
8452 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
8453 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8454 if (__pyx_t_2) {
8455 __Pyx_INCREF(__pyx_t_5);
8456 __pyx_t_4 = __pyx_t_5;
8457 } else {
8458 __Pyx_INCREF(__pyx_t_3);
8459 __pyx_t_4 = __pyx_t_3;
8460 }
8461 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8462 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8463 __pyx_t_5 = __pyx_t_4;
8464 __Pyx_INCREF(__pyx_t_5);
8465 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8466 __pyx_v_factor = __pyx_t_5;
8467 __pyx_t_5 = 0;
8468
8469 /* "pygame_sdl2/rect.pyx":320
8470 * h_ratio = other.h / float(r.h)
8471 * factor = min(w_ratio, h_ratio)
8472 * r.w *= factor # <<<<<<<<<<<<<<
8473 * r.h *= factor
8474 * return r
8475 */
8476 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error)
8477 __Pyx_GOTREF(__pyx_t_5);
8478 __pyx_t_4 = PyNumber_InPlaceMultiply(__pyx_t_5, __pyx_v_factor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
8479 __Pyx_GOTREF(__pyx_t_4);
8480 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8481 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_w, __pyx_t_4) < 0) __PYX_ERR(0, 320, __pyx_L1_error)
8482 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8483
8484 /* "pygame_sdl2/rect.pyx":321
8485 * factor = min(w_ratio, h_ratio)
8486 * r.w *= factor
8487 * r.h *= factor # <<<<<<<<<<<<<<
8488 * return r
8489 *
8490 */
8491 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_r, __pyx_n_s_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
8492 __Pyx_GOTREF(__pyx_t_4);
8493 __pyx_t_5 = PyNumber_InPlaceMultiply(__pyx_t_4, __pyx_v_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error)
8494 __Pyx_GOTREF(__pyx_t_5);
8495 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8496 if (__Pyx_PyObject_SetAttrStr(__pyx_v_r, __pyx_n_s_h, __pyx_t_5) < 0) __PYX_ERR(0, 321, __pyx_L1_error)
8497 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8498
8499 /* "pygame_sdl2/rect.pyx":322
8500 * r.w *= factor
8501 * r.h *= factor
8502 * return r # <<<<<<<<<<<<<<
8503 *
8504 * def normalize(self):
8505 */
8506 __Pyx_XDECREF(__pyx_r);
8507 __Pyx_INCREF(__pyx_v_r);
8508 __pyx_r = __pyx_v_r;
8509 goto __pyx_L0;
8510
8511 /* "pygame_sdl2/rect.pyx":310
8512 * self.union_ip(other)
8513 *
8514 * def fit(self, other): # <<<<<<<<<<<<<<
8515 * if not isinstance(other, Rect):
8516 * other = Rect(other)
8517 */
8518
8519 /* function exit code */
8520 __pyx_L1_error:;
8521 __Pyx_XDECREF(__pyx_t_3);
8522 __Pyx_XDECREF(__pyx_t_4);
8523 __Pyx_XDECREF(__pyx_t_5);
8524 __Pyx_XDECREF(__pyx_t_6);
8525 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.fit", __pyx_clineno, __pyx_lineno, __pyx_filename);
8526 __pyx_r = NULL;
8527 __pyx_L0:;
8528 __Pyx_XDECREF(__pyx_v_r);
8529 __Pyx_XDECREF(__pyx_v_w_ratio);
8530 __Pyx_XDECREF(__pyx_v_h_ratio);
8531 __Pyx_XDECREF(__pyx_v_factor);
8532 __Pyx_XDECREF(__pyx_v_other);
8533 __Pyx_XGIVEREF(__pyx_r);
8534 __Pyx_RefNannyFinishContext();
8535 return __pyx_r;
8536 }
8537
8538 /* "pygame_sdl2/rect.pyx":324
8539 * return r
8540 *
8541 * def normalize(self): # <<<<<<<<<<<<<<
8542 * if self.w < 0:
8543 * self.x += self.w
8544 */
8545
8546 /* Python wrapper */
8547 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)8548 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8549 PyObject *__pyx_r = 0;
8550 __Pyx_RefNannyDeclarations
8551 __Pyx_RefNannySetupContext("normalize (wrapper)", 0);
8552 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
8553
8554 /* function exit code */
8555 __Pyx_RefNannyFinishContext();
8556 return __pyx_r;
8557 }
8558
__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)8559 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_42normalize(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
8560 PyObject *__pyx_r = NULL;
8561 __Pyx_RefNannyDeclarations
8562 int __pyx_t_1;
8563 __Pyx_RefNannySetupContext("normalize", 0);
8564
8565 /* "pygame_sdl2/rect.pyx":325
8566 *
8567 * def normalize(self):
8568 * if self.w < 0: # <<<<<<<<<<<<<<
8569 * self.x += self.w
8570 * self.w = -self.w
8571 */
8572 __pyx_t_1 = ((__pyx_v_self->w < 0) != 0);
8573 if (__pyx_t_1) {
8574
8575 /* "pygame_sdl2/rect.pyx":326
8576 * def normalize(self):
8577 * if self.w < 0:
8578 * self.x += self.w # <<<<<<<<<<<<<<
8579 * self.w = -self.w
8580 * if self.h < 0:
8581 */
8582 __pyx_v_self->x = (__pyx_v_self->x + __pyx_v_self->w);
8583
8584 /* "pygame_sdl2/rect.pyx":327
8585 * if self.w < 0:
8586 * self.x += self.w
8587 * self.w = -self.w # <<<<<<<<<<<<<<
8588 * if self.h < 0:
8589 * self.y += self.h
8590 */
8591 __pyx_v_self->w = (-__pyx_v_self->w);
8592
8593 /* "pygame_sdl2/rect.pyx":325
8594 *
8595 * def normalize(self):
8596 * if self.w < 0: # <<<<<<<<<<<<<<
8597 * self.x += self.w
8598 * self.w = -self.w
8599 */
8600 }
8601
8602 /* "pygame_sdl2/rect.pyx":328
8603 * self.x += self.w
8604 * self.w = -self.w
8605 * if self.h < 0: # <<<<<<<<<<<<<<
8606 * self.y += self.h
8607 * self.h = -self.h
8608 */
8609 __pyx_t_1 = ((__pyx_v_self->h < 0) != 0);
8610 if (__pyx_t_1) {
8611
8612 /* "pygame_sdl2/rect.pyx":329
8613 * self.w = -self.w
8614 * if self.h < 0:
8615 * self.y += self.h # <<<<<<<<<<<<<<
8616 * self.h = -self.h
8617 *
8618 */
8619 __pyx_v_self->y = (__pyx_v_self->y + __pyx_v_self->h);
8620
8621 /* "pygame_sdl2/rect.pyx":330
8622 * if self.h < 0:
8623 * self.y += self.h
8624 * self.h = -self.h # <<<<<<<<<<<<<<
8625 *
8626 * def contains(self, other):
8627 */
8628 __pyx_v_self->h = (-__pyx_v_self->h);
8629
8630 /* "pygame_sdl2/rect.pyx":328
8631 * self.x += self.w
8632 * self.w = -self.w
8633 * if self.h < 0: # <<<<<<<<<<<<<<
8634 * self.y += self.h
8635 * self.h = -self.h
8636 */
8637 }
8638
8639 /* "pygame_sdl2/rect.pyx":324
8640 * return r
8641 *
8642 * def normalize(self): # <<<<<<<<<<<<<<
8643 * if self.w < 0:
8644 * self.x += self.w
8645 */
8646
8647 /* function exit code */
8648 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8649 __Pyx_XGIVEREF(__pyx_r);
8650 __Pyx_RefNannyFinishContext();
8651 return __pyx_r;
8652 }
8653
8654 /* "pygame_sdl2/rect.pyx":332
8655 * self.h = -self.h
8656 *
8657 * def contains(self, other): # <<<<<<<<<<<<<<
8658 * if not isinstance(other, Rect):
8659 * other = Rect(other)
8660 */
8661
8662 /* Python wrapper */
8663 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject * __pyx_v_self,PyObject * __pyx_v_other)8664 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
8665 PyObject *__pyx_r = 0;
8666 __Pyx_RefNannyDeclarations
8667 __Pyx_RefNannySetupContext("contains (wrapper)", 0);
8668 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other));
8669
8670 /* function exit code */
8671 __Pyx_RefNannyFinishContext();
8672 return __pyx_r;
8673 }
8674
__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other)8675 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_44contains(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) {
8676 PyObject *__pyx_r = NULL;
8677 __Pyx_RefNannyDeclarations
8678 int __pyx_t_1;
8679 int __pyx_t_2;
8680 PyObject *__pyx_t_3 = NULL;
8681 PyObject *__pyx_t_4 = NULL;
8682 PyObject *__pyx_t_5 = NULL;
8683 PyObject *__pyx_t_6 = NULL;
8684 int __pyx_lineno = 0;
8685 const char *__pyx_filename = NULL;
8686 int __pyx_clineno = 0;
8687 __Pyx_RefNannySetupContext("contains", 0);
8688 __Pyx_INCREF(__pyx_v_other);
8689
8690 /* "pygame_sdl2/rect.pyx":333
8691 *
8692 * def contains(self, other):
8693 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
8694 * other = Rect(other)
8695 *
8696 */
8697 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect);
8698 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
8699 if (__pyx_t_2) {
8700
8701 /* "pygame_sdl2/rect.pyx":334
8702 * def contains(self, other):
8703 * if not isinstance(other, Rect):
8704 * other = Rect(other) # <<<<<<<<<<<<<<
8705 *
8706 * return other.x >= self.x and other.right <= self.right and \
8707 */
8708 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 334, __pyx_L1_error)
8709 __Pyx_GOTREF(__pyx_t_3);
8710 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
8711 __pyx_t_3 = 0;
8712
8713 /* "pygame_sdl2/rect.pyx":333
8714 *
8715 * def contains(self, other):
8716 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
8717 * other = Rect(other)
8718 *
8719 */
8720 }
8721
8722 /* "pygame_sdl2/rect.pyx":336
8723 * other = Rect(other)
8724 *
8725 * return other.x >= self.x and other.right <= self.right and \ # <<<<<<<<<<<<<<
8726 * other.y >= self.y and other.bottom <= self.bottom and \
8727 * other.left < self.right and other.top < self.bottom
8728 */
8729 __Pyx_XDECREF(__pyx_r);
8730 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error)
8731 __Pyx_GOTREF(__pyx_t_4);
8732 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
8733 __Pyx_GOTREF(__pyx_t_5);
8734 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error)
8735 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8736 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8737 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
8738 if (__pyx_t_2) {
8739 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8740 } else {
8741 __Pyx_INCREF(__pyx_t_6);
8742 __pyx_t_3 = __pyx_t_6;
8743 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8744 goto __pyx_L4_bool_binop_done;
8745 }
8746 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error)
8747 __Pyx_GOTREF(__pyx_t_6);
8748 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
8749 __Pyx_GOTREF(__pyx_t_5);
8750 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error)
8751 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8752 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8753 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
8754 if (__pyx_t_2) {
8755 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8756 } else {
8757 __Pyx_INCREF(__pyx_t_4);
8758 __pyx_t_3 = __pyx_t_4;
8759 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8760 goto __pyx_L4_bool_binop_done;
8761 }
8762
8763 /* "pygame_sdl2/rect.pyx":337
8764 *
8765 * return other.x >= self.x and other.right <= self.right and \
8766 * other.y >= self.y and other.bottom <= self.bottom and \ # <<<<<<<<<<<<<<
8767 * other.left < self.right and other.top < self.bottom
8768 *
8769 */
8770 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
8771 __Pyx_GOTREF(__pyx_t_4);
8772 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
8773 __Pyx_GOTREF(__pyx_t_5);
8774 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
8775 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8776 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8777 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
8778 if (__pyx_t_2) {
8779 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8780 } else {
8781 __Pyx_INCREF(__pyx_t_6);
8782 __pyx_t_3 = __pyx_t_6;
8783 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8784 goto __pyx_L4_bool_binop_done;
8785 }
8786 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error)
8787 __Pyx_GOTREF(__pyx_t_6);
8788 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
8789 __Pyx_GOTREF(__pyx_t_5);
8790 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 337, __pyx_L1_error)
8791 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8792 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8793 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
8794 if (__pyx_t_2) {
8795 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8796 } else {
8797 __Pyx_INCREF(__pyx_t_4);
8798 __pyx_t_3 = __pyx_t_4;
8799 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8800 goto __pyx_L4_bool_binop_done;
8801 }
8802
8803 /* "pygame_sdl2/rect.pyx":338
8804 * return other.x >= self.x and other.right <= self.right and \
8805 * other.y >= self.y and other.bottom <= self.bottom and \
8806 * other.left < self.right and other.top < self.bottom # <<<<<<<<<<<<<<
8807 *
8808 * def collidepoint(self, x, y=None):
8809 */
8810 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
8811 __Pyx_GOTREF(__pyx_t_4);
8812 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
8813 __Pyx_GOTREF(__pyx_t_5);
8814 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error)
8815 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8816 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8817 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 338, __pyx_L1_error)
8818 if (__pyx_t_2) {
8819 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8820 } else {
8821 __Pyx_INCREF(__pyx_t_6);
8822 __pyx_t_3 = __pyx_t_6;
8823 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8824 goto __pyx_L4_bool_binop_done;
8825 }
8826 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 338, __pyx_L1_error)
8827 __Pyx_GOTREF(__pyx_t_6);
8828 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
8829 __Pyx_GOTREF(__pyx_t_5);
8830 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 338, __pyx_L1_error)
8831 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8832 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8833 __Pyx_INCREF(__pyx_t_4);
8834 __pyx_t_3 = __pyx_t_4;
8835 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8836 __pyx_L4_bool_binop_done:;
8837 __pyx_r = __pyx_t_3;
8838 __pyx_t_3 = 0;
8839 goto __pyx_L0;
8840
8841 /* "pygame_sdl2/rect.pyx":332
8842 * self.h = -self.h
8843 *
8844 * def contains(self, other): # <<<<<<<<<<<<<<
8845 * if not isinstance(other, Rect):
8846 * other = Rect(other)
8847 */
8848
8849 /* function exit code */
8850 __pyx_L1_error:;
8851 __Pyx_XDECREF(__pyx_t_3);
8852 __Pyx_XDECREF(__pyx_t_4);
8853 __Pyx_XDECREF(__pyx_t_5);
8854 __Pyx_XDECREF(__pyx_t_6);
8855 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.contains", __pyx_clineno, __pyx_lineno, __pyx_filename);
8856 __pyx_r = NULL;
8857 __pyx_L0:;
8858 __Pyx_XDECREF(__pyx_v_other);
8859 __Pyx_XGIVEREF(__pyx_r);
8860 __Pyx_RefNannyFinishContext();
8861 return __pyx_r;
8862 }
8863
8864 /* "pygame_sdl2/rect.pyx":340
8865 * other.left < self.right and other.top < self.bottom
8866 *
8867 * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<<
8868 * if type(x) == tuple:
8869 * x, y = x
8870 */
8871
8872 /* Python wrapper */
8873 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)8874 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8875 PyObject *__pyx_v_x = 0;
8876 PyObject *__pyx_v_y = 0;
8877 int __pyx_lineno = 0;
8878 const char *__pyx_filename = NULL;
8879 int __pyx_clineno = 0;
8880 PyObject *__pyx_r = 0;
8881 __Pyx_RefNannyDeclarations
8882 __Pyx_RefNannySetupContext("collidepoint (wrapper)", 0);
8883 {
8884 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,0};
8885 PyObject* values[2] = {0,0};
8886 values[1] = ((PyObject *)Py_None);
8887 if (unlikely(__pyx_kwds)) {
8888 Py_ssize_t kw_args;
8889 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8890 switch (pos_args) {
8891 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8892 CYTHON_FALLTHROUGH;
8893 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8894 CYTHON_FALLTHROUGH;
8895 case 0: break;
8896 default: goto __pyx_L5_argtuple_error;
8897 }
8898 kw_args = PyDict_Size(__pyx_kwds);
8899 switch (pos_args) {
8900 case 0:
8901 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
8902 else goto __pyx_L5_argtuple_error;
8903 CYTHON_FALLTHROUGH;
8904 case 1:
8905 if (kw_args > 0) {
8906 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y);
8907 if (value) { values[1] = value; kw_args--; }
8908 }
8909 }
8910 if (unlikely(kw_args > 0)) {
8911 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collidepoint") < 0)) __PYX_ERR(0, 340, __pyx_L3_error)
8912 }
8913 } else {
8914 switch (PyTuple_GET_SIZE(__pyx_args)) {
8915 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8916 CYTHON_FALLTHROUGH;
8917 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8918 break;
8919 default: goto __pyx_L5_argtuple_error;
8920 }
8921 }
8922 __pyx_v_x = values[0];
8923 __pyx_v_y = values[1];
8924 }
8925 goto __pyx_L4_argument_unpacking_done;
8926 __pyx_L5_argtuple_error:;
8927 __Pyx_RaiseArgtupleInvalid("collidepoint", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 340, __pyx_L3_error)
8928 __pyx_L3_error:;
8929 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidepoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
8930 __Pyx_RefNannyFinishContext();
8931 return NULL;
8932 __pyx_L4_argument_unpacking_done:;
8933 __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);
8934
8935 /* function exit code */
8936 __Pyx_RefNannyFinishContext();
8937 return __pyx_r;
8938 }
8939
__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)8940 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) {
8941 PyObject *__pyx_r = NULL;
8942 __Pyx_RefNannyDeclarations
8943 PyObject *__pyx_t_1 = NULL;
8944 int __pyx_t_2;
8945 PyObject *__pyx_t_3 = NULL;
8946 PyObject *__pyx_t_4 = NULL;
8947 PyObject *(*__pyx_t_5)(PyObject *);
8948 int __pyx_lineno = 0;
8949 const char *__pyx_filename = NULL;
8950 int __pyx_clineno = 0;
8951 __Pyx_RefNannySetupContext("collidepoint", 0);
8952 __Pyx_INCREF(__pyx_v_x);
8953 __Pyx_INCREF(__pyx_v_y);
8954
8955 /* "pygame_sdl2/rect.pyx":341
8956 *
8957 * def collidepoint(self, x, y=None):
8958 * if type(x) == tuple: # <<<<<<<<<<<<<<
8959 * x, y = x
8960 * return x >= self.x and y >= self.y and \
8961 */
8962 __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_ERR(0, 341, __pyx_L1_error)
8963 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 341, __pyx_L1_error)
8964 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8965 if (__pyx_t_2) {
8966
8967 /* "pygame_sdl2/rect.pyx":342
8968 * def collidepoint(self, x, y=None):
8969 * if type(x) == tuple:
8970 * x, y = x # <<<<<<<<<<<<<<
8971 * return x >= self.x and y >= self.y and \
8972 * x < self.right and y < self.bottom
8973 */
8974 if ((likely(PyTuple_CheckExact(__pyx_v_x))) || (PyList_CheckExact(__pyx_v_x))) {
8975 PyObject* sequence = __pyx_v_x;
8976 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
8977 if (unlikely(size != 2)) {
8978 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
8979 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
8980 __PYX_ERR(0, 342, __pyx_L1_error)
8981 }
8982 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8983 if (likely(PyTuple_CheckExact(sequence))) {
8984 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
8985 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
8986 } else {
8987 __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
8988 __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
8989 }
8990 __Pyx_INCREF(__pyx_t_1);
8991 __Pyx_INCREF(__pyx_t_3);
8992 #else
8993 __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
8994 __Pyx_GOTREF(__pyx_t_1);
8995 __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error)
8996 __Pyx_GOTREF(__pyx_t_3);
8997 #endif
8998 } else {
8999 Py_ssize_t index = -1;
9000 __pyx_t_4 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error)
9001 __Pyx_GOTREF(__pyx_t_4);
9002 __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
9003 index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L4_unpacking_failed;
9004 __Pyx_GOTREF(__pyx_t_1);
9005 index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
9006 __Pyx_GOTREF(__pyx_t_3);
9007 if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 342, __pyx_L1_error)
9008 __pyx_t_5 = NULL;
9009 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9010 goto __pyx_L5_unpacking_done;
9011 __pyx_L4_unpacking_failed:;
9012 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9013 __pyx_t_5 = NULL;
9014 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
9015 __PYX_ERR(0, 342, __pyx_L1_error)
9016 __pyx_L5_unpacking_done:;
9017 }
9018 __Pyx_DECREF_SET(__pyx_v_x, __pyx_t_1);
9019 __pyx_t_1 = 0;
9020 __Pyx_DECREF_SET(__pyx_v_y, __pyx_t_3);
9021 __pyx_t_3 = 0;
9022
9023 /* "pygame_sdl2/rect.pyx":341
9024 *
9025 * def collidepoint(self, x, y=None):
9026 * if type(x) == tuple: # <<<<<<<<<<<<<<
9027 * x, y = x
9028 * return x >= self.x and y >= self.y and \
9029 */
9030 }
9031
9032 /* "pygame_sdl2/rect.pyx":343
9033 * if type(x) == tuple:
9034 * x, y = x
9035 * return x >= self.x and y >= self.y and \ # <<<<<<<<<<<<<<
9036 * x < self.right and y < self.bottom
9037 *
9038 */
9039 __Pyx_XDECREF(__pyx_r);
9040 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
9041 __Pyx_GOTREF(__pyx_t_1);
9042 __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
9043 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9044 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
9045 if (__pyx_t_2) {
9046 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9047 } else {
9048 __Pyx_INCREF(__pyx_t_4);
9049 __pyx_t_3 = __pyx_t_4;
9050 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9051 goto __pyx_L6_bool_binop_done;
9052 }
9053 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 343, __pyx_L1_error)
9054 __Pyx_GOTREF(__pyx_t_4);
9055 __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 343, __pyx_L1_error)
9056 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9057 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
9058 if (__pyx_t_2) {
9059 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9060 } else {
9061 __Pyx_INCREF(__pyx_t_1);
9062 __pyx_t_3 = __pyx_t_1;
9063 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9064 goto __pyx_L6_bool_binop_done;
9065 }
9066
9067 /* "pygame_sdl2/rect.pyx":344
9068 * x, y = x
9069 * return x >= self.x and y >= self.y and \
9070 * x < self.right and y < self.bottom # <<<<<<<<<<<<<<
9071 *
9072 * def colliderect(self, other):
9073 */
9074 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
9075 __Pyx_GOTREF(__pyx_t_1);
9076 __pyx_t_4 = PyObject_RichCompare(__pyx_v_x, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
9077 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9078 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 344, __pyx_L1_error)
9079 if (__pyx_t_2) {
9080 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9081 } else {
9082 __Pyx_INCREF(__pyx_t_4);
9083 __pyx_t_3 = __pyx_t_4;
9084 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9085 goto __pyx_L6_bool_binop_done;
9086 }
9087 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 344, __pyx_L1_error)
9088 __Pyx_GOTREF(__pyx_t_4);
9089 __pyx_t_1 = PyObject_RichCompare(__pyx_v_y, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
9090 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9091 __Pyx_INCREF(__pyx_t_1);
9092 __pyx_t_3 = __pyx_t_1;
9093 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9094 __pyx_L6_bool_binop_done:;
9095 __pyx_r = __pyx_t_3;
9096 __pyx_t_3 = 0;
9097 goto __pyx_L0;
9098
9099 /* "pygame_sdl2/rect.pyx":340
9100 * other.left < self.right and other.top < self.bottom
9101 *
9102 * def collidepoint(self, x, y=None): # <<<<<<<<<<<<<<
9103 * if type(x) == tuple:
9104 * x, y = x
9105 */
9106
9107 /* function exit code */
9108 __pyx_L1_error:;
9109 __Pyx_XDECREF(__pyx_t_1);
9110 __Pyx_XDECREF(__pyx_t_3);
9111 __Pyx_XDECREF(__pyx_t_4);
9112 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidepoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
9113 __pyx_r = NULL;
9114 __pyx_L0:;
9115 __Pyx_XDECREF(__pyx_v_x);
9116 __Pyx_XDECREF(__pyx_v_y);
9117 __Pyx_XGIVEREF(__pyx_r);
9118 __Pyx_RefNannyFinishContext();
9119 return __pyx_r;
9120 }
9121
9122 /* "pygame_sdl2/rect.pyx":346
9123 * x < self.right and y < self.bottom
9124 *
9125 * def colliderect(self, other): # <<<<<<<<<<<<<<
9126 * if not isinstance(other, Rect):
9127 * other = Rect(other)
9128 */
9129
9130 /* Python wrapper */
9131 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject * __pyx_v_self,PyObject * __pyx_v_other)9132 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
9133 PyObject *__pyx_r = 0;
9134 __Pyx_RefNannyDeclarations
9135 __Pyx_RefNannySetupContext("colliderect (wrapper)", 0);
9136 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other));
9137
9138 /* function exit code */
9139 __Pyx_RefNannyFinishContext();
9140 return __pyx_r;
9141 }
9142
__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other)9143 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_48colliderect(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other) {
9144 PyObject *__pyx_r = NULL;
9145 __Pyx_RefNannyDeclarations
9146 int __pyx_t_1;
9147 int __pyx_t_2;
9148 PyObject *__pyx_t_3 = NULL;
9149 PyObject *__pyx_t_4 = NULL;
9150 PyObject *__pyx_t_5 = NULL;
9151 PyObject *__pyx_t_6 = NULL;
9152 int __pyx_lineno = 0;
9153 const char *__pyx_filename = NULL;
9154 int __pyx_clineno = 0;
9155 __Pyx_RefNannySetupContext("colliderect", 0);
9156 __Pyx_INCREF(__pyx_v_other);
9157
9158 /* "pygame_sdl2/rect.pyx":347
9159 *
9160 * def colliderect(self, other):
9161 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
9162 * other = Rect(other)
9163 *
9164 */
9165 __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_other, __pyx_ptype_11pygame_sdl2_4rect_Rect);
9166 __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
9167 if (__pyx_t_2) {
9168
9169 /* "pygame_sdl2/rect.pyx":348
9170 * def colliderect(self, other):
9171 * if not isinstance(other, Rect):
9172 * other = Rect(other) # <<<<<<<<<<<<<<
9173 *
9174 * return self.left < other.right and self.top < other.bottom and \
9175 */
9176 __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_11pygame_sdl2_4rect_Rect), __pyx_v_other); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 348, __pyx_L1_error)
9177 __Pyx_GOTREF(__pyx_t_3);
9178 __Pyx_DECREF_SET(__pyx_v_other, __pyx_t_3);
9179 __pyx_t_3 = 0;
9180
9181 /* "pygame_sdl2/rect.pyx":347
9182 *
9183 * def colliderect(self, other):
9184 * if not isinstance(other, Rect): # <<<<<<<<<<<<<<
9185 * other = Rect(other)
9186 *
9187 */
9188 }
9189
9190 /* "pygame_sdl2/rect.pyx":350
9191 * other = Rect(other)
9192 *
9193 * return self.left < other.right and self.top < other.bottom and \ # <<<<<<<<<<<<<<
9194 * self.right > other.left and self.bottom > other.top
9195 *
9196 */
9197 __Pyx_XDECREF(__pyx_r);
9198 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_left); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
9199 __Pyx_GOTREF(__pyx_t_4);
9200 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_right); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
9201 __Pyx_GOTREF(__pyx_t_5);
9202 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
9203 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9205 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 350, __pyx_L1_error)
9206 if (__pyx_t_2) {
9207 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9208 } else {
9209 __Pyx_INCREF(__pyx_t_6);
9210 __pyx_t_3 = __pyx_t_6;
9211 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9212 goto __pyx_L4_bool_binop_done;
9213 }
9214 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_top); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
9215 __Pyx_GOTREF(__pyx_t_6);
9216 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_bottom); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
9217 __Pyx_GOTREF(__pyx_t_5);
9218 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
9219 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9220 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9221 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 350, __pyx_L1_error)
9222 if (__pyx_t_2) {
9223 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9224 } else {
9225 __Pyx_INCREF(__pyx_t_4);
9226 __pyx_t_3 = __pyx_t_4;
9227 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9228 goto __pyx_L4_bool_binop_done;
9229 }
9230
9231 /* "pygame_sdl2/rect.pyx":351
9232 *
9233 * return self.left < other.right and self.top < other.bottom and \
9234 * self.right > other.left and self.bottom > other.top # <<<<<<<<<<<<<<
9235 *
9236 * def collidelist(self, other_list):
9237 */
9238 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_right); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
9239 __Pyx_GOTREF(__pyx_t_4);
9240 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_left); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
9241 __Pyx_GOTREF(__pyx_t_5);
9242 __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
9243 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9244 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9245 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
9246 if (__pyx_t_2) {
9247 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9248 } else {
9249 __Pyx_INCREF(__pyx_t_6);
9250 __pyx_t_3 = __pyx_t_6;
9251 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9252 goto __pyx_L4_bool_binop_done;
9253 }
9254 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_bottom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 351, __pyx_L1_error)
9255 __Pyx_GOTREF(__pyx_t_6);
9256 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_other, __pyx_n_s_top); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
9257 __Pyx_GOTREF(__pyx_t_5);
9258 __pyx_t_4 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 351, __pyx_L1_error)
9259 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9260 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9261 __Pyx_INCREF(__pyx_t_4);
9262 __pyx_t_3 = __pyx_t_4;
9263 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9264 __pyx_L4_bool_binop_done:;
9265 __pyx_r = __pyx_t_3;
9266 __pyx_t_3 = 0;
9267 goto __pyx_L0;
9268
9269 /* "pygame_sdl2/rect.pyx":346
9270 * x < self.right and y < self.bottom
9271 *
9272 * def colliderect(self, other): # <<<<<<<<<<<<<<
9273 * if not isinstance(other, Rect):
9274 * other = Rect(other)
9275 */
9276
9277 /* function exit code */
9278 __pyx_L1_error:;
9279 __Pyx_XDECREF(__pyx_t_3);
9280 __Pyx_XDECREF(__pyx_t_4);
9281 __Pyx_XDECREF(__pyx_t_5);
9282 __Pyx_XDECREF(__pyx_t_6);
9283 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.colliderect", __pyx_clineno, __pyx_lineno, __pyx_filename);
9284 __pyx_r = NULL;
9285 __pyx_L0:;
9286 __Pyx_XDECREF(__pyx_v_other);
9287 __Pyx_XGIVEREF(__pyx_r);
9288 __Pyx_RefNannyFinishContext();
9289 return __pyx_r;
9290 }
9291
9292 /* "pygame_sdl2/rect.pyx":353
9293 * self.right > other.left and self.bottom > other.top
9294 *
9295 * def collidelist(self, other_list): # <<<<<<<<<<<<<<
9296 * for n, other in zip(range(len(other_list)), other_list):
9297 * if self.colliderect(other):
9298 */
9299
9300 /* Python wrapper */
9301 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject * __pyx_v_self,PyObject * __pyx_v_other_list)9302 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list) {
9303 PyObject *__pyx_r = 0;
9304 __Pyx_RefNannyDeclarations
9305 __Pyx_RefNannySetupContext("collidelist (wrapper)", 0);
9306 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_list));
9307
9308 /* function exit code */
9309 __Pyx_RefNannyFinishContext();
9310 return __pyx_r;
9311 }
9312
__pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other_list)9313 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_50collidelist(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list) {
9314 PyObject *__pyx_v_n = NULL;
9315 PyObject *__pyx_v_other = NULL;
9316 PyObject *__pyx_r = NULL;
9317 __Pyx_RefNannyDeclarations
9318 Py_ssize_t __pyx_t_1;
9319 PyObject *__pyx_t_2 = NULL;
9320 PyObject *__pyx_t_3 = NULL;
9321 PyObject *(*__pyx_t_4)(PyObject *);
9322 PyObject *__pyx_t_5 = NULL;
9323 PyObject *__pyx_t_6 = NULL;
9324 PyObject *__pyx_t_7 = NULL;
9325 PyObject *(*__pyx_t_8)(PyObject *);
9326 int __pyx_t_9;
9327 int __pyx_lineno = 0;
9328 const char *__pyx_filename = NULL;
9329 int __pyx_clineno = 0;
9330 __Pyx_RefNannySetupContext("collidelist", 0);
9331
9332 /* "pygame_sdl2/rect.pyx":354
9333 *
9334 * def collidelist(self, other_list):
9335 * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<<
9336 * if self.colliderect(other):
9337 * return n
9338 */
9339 __pyx_t_1 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 354, __pyx_L1_error)
9340 __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
9341 __Pyx_GOTREF(__pyx_t_2);
9342 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
9343 __Pyx_GOTREF(__pyx_t_3);
9344 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9345 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
9346 __Pyx_GOTREF(__pyx_t_2);
9347 __Pyx_GIVEREF(__pyx_t_3);
9348 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
9349 __Pyx_INCREF(__pyx_v_other_list);
9350 __Pyx_GIVEREF(__pyx_v_other_list);
9351 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_other_list);
9352 __pyx_t_3 = 0;
9353 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
9354 __Pyx_GOTREF(__pyx_t_3);
9355 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9356 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
9357 __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_1 = 0;
9358 __pyx_t_4 = NULL;
9359 } else {
9360 __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error)
9361 __Pyx_GOTREF(__pyx_t_2);
9362 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 354, __pyx_L1_error)
9363 }
9364 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9365 for (;;) {
9366 if (likely(!__pyx_t_4)) {
9367 if (likely(PyList_CheckExact(__pyx_t_2))) {
9368 if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
9369 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9370 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 354, __pyx_L1_error)
9371 #else
9372 __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
9373 __Pyx_GOTREF(__pyx_t_3);
9374 #endif
9375 } else {
9376 if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9377 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9378 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 354, __pyx_L1_error)
9379 #else
9380 __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 354, __pyx_L1_error)
9381 __Pyx_GOTREF(__pyx_t_3);
9382 #endif
9383 }
9384 } else {
9385 __pyx_t_3 = __pyx_t_4(__pyx_t_2);
9386 if (unlikely(!__pyx_t_3)) {
9387 PyObject* exc_type = PyErr_Occurred();
9388 if (exc_type) {
9389 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9390 else __PYX_ERR(0, 354, __pyx_L1_error)
9391 }
9392 break;
9393 }
9394 __Pyx_GOTREF(__pyx_t_3);
9395 }
9396 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
9397 PyObject* sequence = __pyx_t_3;
9398 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9399 if (unlikely(size != 2)) {
9400 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9401 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9402 __PYX_ERR(0, 354, __pyx_L1_error)
9403 }
9404 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9405 if (likely(PyTuple_CheckExact(sequence))) {
9406 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
9407 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
9408 } else {
9409 __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
9410 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
9411 }
9412 __Pyx_INCREF(__pyx_t_5);
9413 __Pyx_INCREF(__pyx_t_6);
9414 #else
9415 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error)
9416 __Pyx_GOTREF(__pyx_t_5);
9417 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
9418 __Pyx_GOTREF(__pyx_t_6);
9419 #endif
9420 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9421 } else {
9422 Py_ssize_t index = -1;
9423 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error)
9424 __Pyx_GOTREF(__pyx_t_7);
9425 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9426 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
9427 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
9428 __Pyx_GOTREF(__pyx_t_5);
9429 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
9430 __Pyx_GOTREF(__pyx_t_6);
9431 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 354, __pyx_L1_error)
9432 __pyx_t_8 = NULL;
9433 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9434 goto __pyx_L6_unpacking_done;
9435 __pyx_L5_unpacking_failed:;
9436 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9437 __pyx_t_8 = NULL;
9438 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
9439 __PYX_ERR(0, 354, __pyx_L1_error)
9440 __pyx_L6_unpacking_done:;
9441 }
9442 __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
9443 __pyx_t_5 = 0;
9444 __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_6);
9445 __pyx_t_6 = 0;
9446
9447 /* "pygame_sdl2/rect.pyx":355
9448 * def collidelist(self, other_list):
9449 * for n, other in zip(range(len(other_list)), other_list):
9450 * if self.colliderect(other): # <<<<<<<<<<<<<<
9451 * return n
9452 * return -1
9453 */
9454 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error)
9455 __Pyx_GOTREF(__pyx_t_6);
9456 __pyx_t_5 = NULL;
9457 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
9458 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
9459 if (likely(__pyx_t_5)) {
9460 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
9461 __Pyx_INCREF(__pyx_t_5);
9462 __Pyx_INCREF(function);
9463 __Pyx_DECREF_SET(__pyx_t_6, function);
9464 }
9465 }
9466 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other);
9467 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9468 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 355, __pyx_L1_error)
9469 __Pyx_GOTREF(__pyx_t_3);
9470 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9471 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 355, __pyx_L1_error)
9472 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9473 if (__pyx_t_9) {
9474
9475 /* "pygame_sdl2/rect.pyx":356
9476 * for n, other in zip(range(len(other_list)), other_list):
9477 * if self.colliderect(other):
9478 * return n # <<<<<<<<<<<<<<
9479 * return -1
9480 *
9481 */
9482 __Pyx_XDECREF(__pyx_r);
9483 __Pyx_INCREF(__pyx_v_n);
9484 __pyx_r = __pyx_v_n;
9485 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9486 goto __pyx_L0;
9487
9488 /* "pygame_sdl2/rect.pyx":355
9489 * def collidelist(self, other_list):
9490 * for n, other in zip(range(len(other_list)), other_list):
9491 * if self.colliderect(other): # <<<<<<<<<<<<<<
9492 * return n
9493 * return -1
9494 */
9495 }
9496
9497 /* "pygame_sdl2/rect.pyx":354
9498 *
9499 * def collidelist(self, other_list):
9500 * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<<
9501 * if self.colliderect(other):
9502 * return n
9503 */
9504 }
9505 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9506
9507 /* "pygame_sdl2/rect.pyx":357
9508 * if self.colliderect(other):
9509 * return n
9510 * return -1 # <<<<<<<<<<<<<<
9511 *
9512 * def collidelistall(self, other_list):
9513 */
9514 __Pyx_XDECREF(__pyx_r);
9515 __Pyx_INCREF(__pyx_int_neg_1);
9516 __pyx_r = __pyx_int_neg_1;
9517 goto __pyx_L0;
9518
9519 /* "pygame_sdl2/rect.pyx":353
9520 * self.right > other.left and self.bottom > other.top
9521 *
9522 * def collidelist(self, other_list): # <<<<<<<<<<<<<<
9523 * for n, other in zip(range(len(other_list)), other_list):
9524 * if self.colliderect(other):
9525 */
9526
9527 /* function exit code */
9528 __pyx_L1_error:;
9529 __Pyx_XDECREF(__pyx_t_2);
9530 __Pyx_XDECREF(__pyx_t_3);
9531 __Pyx_XDECREF(__pyx_t_5);
9532 __Pyx_XDECREF(__pyx_t_6);
9533 __Pyx_XDECREF(__pyx_t_7);
9534 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelist", __pyx_clineno, __pyx_lineno, __pyx_filename);
9535 __pyx_r = NULL;
9536 __pyx_L0:;
9537 __Pyx_XDECREF(__pyx_v_n);
9538 __Pyx_XDECREF(__pyx_v_other);
9539 __Pyx_XGIVEREF(__pyx_r);
9540 __Pyx_RefNannyFinishContext();
9541 return __pyx_r;
9542 }
9543
9544 /* "pygame_sdl2/rect.pyx":359
9545 * return -1
9546 *
9547 * def collidelistall(self, other_list): # <<<<<<<<<<<<<<
9548 * ret = []
9549 * for n, other in zip(range(len(other_list)), other_list):
9550 */
9551
9552 /* Python wrapper */
9553 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject * __pyx_v_self,PyObject * __pyx_v_other_list)9554 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall(PyObject *__pyx_v_self, PyObject *__pyx_v_other_list) {
9555 PyObject *__pyx_r = 0;
9556 __Pyx_RefNannyDeclarations
9557 __Pyx_RefNannySetupContext("collidelistall (wrapper)", 0);
9558 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self), ((PyObject *)__pyx_v_other_list));
9559
9560 /* function exit code */
9561 __Pyx_RefNannyFinishContext();
9562 return __pyx_r;
9563 }
9564
__pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_other_list)9565 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_52collidelistall(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self, PyObject *__pyx_v_other_list) {
9566 PyObject *__pyx_v_ret = NULL;
9567 PyObject *__pyx_v_n = NULL;
9568 PyObject *__pyx_v_other = NULL;
9569 PyObject *__pyx_r = NULL;
9570 __Pyx_RefNannyDeclarations
9571 PyObject *__pyx_t_1 = NULL;
9572 Py_ssize_t __pyx_t_2;
9573 PyObject *__pyx_t_3 = NULL;
9574 PyObject *(*__pyx_t_4)(PyObject *);
9575 PyObject *__pyx_t_5 = NULL;
9576 PyObject *__pyx_t_6 = NULL;
9577 PyObject *__pyx_t_7 = NULL;
9578 PyObject *(*__pyx_t_8)(PyObject *);
9579 int __pyx_t_9;
9580 int __pyx_t_10;
9581 int __pyx_lineno = 0;
9582 const char *__pyx_filename = NULL;
9583 int __pyx_clineno = 0;
9584 __Pyx_RefNannySetupContext("collidelistall", 0);
9585
9586 /* "pygame_sdl2/rect.pyx":360
9587 *
9588 * def collidelistall(self, other_list):
9589 * ret = [] # <<<<<<<<<<<<<<
9590 * for n, other in zip(range(len(other_list)), other_list):
9591 * if self.colliderect(other):
9592 */
9593 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
9594 __Pyx_GOTREF(__pyx_t_1);
9595 __pyx_v_ret = ((PyObject*)__pyx_t_1);
9596 __pyx_t_1 = 0;
9597
9598 /* "pygame_sdl2/rect.pyx":361
9599 * def collidelistall(self, other_list):
9600 * ret = []
9601 * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<<
9602 * if self.colliderect(other):
9603 * ret.append(n)
9604 */
9605 __pyx_t_2 = PyObject_Length(__pyx_v_other_list); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 361, __pyx_L1_error)
9606 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
9607 __Pyx_GOTREF(__pyx_t_1);
9608 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
9609 __Pyx_GOTREF(__pyx_t_3);
9610 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9611 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
9612 __Pyx_GOTREF(__pyx_t_1);
9613 __Pyx_GIVEREF(__pyx_t_3);
9614 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
9615 __Pyx_INCREF(__pyx_v_other_list);
9616 __Pyx_GIVEREF(__pyx_v_other_list);
9617 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_other_list);
9618 __pyx_t_3 = 0;
9619 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
9620 __Pyx_GOTREF(__pyx_t_3);
9621 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9622 if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
9623 __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
9624 __pyx_t_4 = NULL;
9625 } else {
9626 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
9627 __Pyx_GOTREF(__pyx_t_1);
9628 __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 361, __pyx_L1_error)
9629 }
9630 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9631 for (;;) {
9632 if (likely(!__pyx_t_4)) {
9633 if (likely(PyList_CheckExact(__pyx_t_1))) {
9634 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
9635 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9636 __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
9637 #else
9638 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
9639 __Pyx_GOTREF(__pyx_t_3);
9640 #endif
9641 } else {
9642 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
9643 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9644 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
9645 #else
9646 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 361, __pyx_L1_error)
9647 __Pyx_GOTREF(__pyx_t_3);
9648 #endif
9649 }
9650 } else {
9651 __pyx_t_3 = __pyx_t_4(__pyx_t_1);
9652 if (unlikely(!__pyx_t_3)) {
9653 PyObject* exc_type = PyErr_Occurred();
9654 if (exc_type) {
9655 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9656 else __PYX_ERR(0, 361, __pyx_L1_error)
9657 }
9658 break;
9659 }
9660 __Pyx_GOTREF(__pyx_t_3);
9661 }
9662 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
9663 PyObject* sequence = __pyx_t_3;
9664 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9665 if (unlikely(size != 2)) {
9666 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9667 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9668 __PYX_ERR(0, 361, __pyx_L1_error)
9669 }
9670 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9671 if (likely(PyTuple_CheckExact(sequence))) {
9672 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
9673 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
9674 } else {
9675 __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
9676 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
9677 }
9678 __Pyx_INCREF(__pyx_t_5);
9679 __Pyx_INCREF(__pyx_t_6);
9680 #else
9681 __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 361, __pyx_L1_error)
9682 __Pyx_GOTREF(__pyx_t_5);
9683 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 361, __pyx_L1_error)
9684 __Pyx_GOTREF(__pyx_t_6);
9685 #endif
9686 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9687 } else {
9688 Py_ssize_t index = -1;
9689 __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 361, __pyx_L1_error)
9690 __Pyx_GOTREF(__pyx_t_7);
9691 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9692 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
9693 index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
9694 __Pyx_GOTREF(__pyx_t_5);
9695 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
9696 __Pyx_GOTREF(__pyx_t_6);
9697 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 361, __pyx_L1_error)
9698 __pyx_t_8 = NULL;
9699 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9700 goto __pyx_L6_unpacking_done;
9701 __pyx_L5_unpacking_failed:;
9702 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9703 __pyx_t_8 = NULL;
9704 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
9705 __PYX_ERR(0, 361, __pyx_L1_error)
9706 __pyx_L6_unpacking_done:;
9707 }
9708 __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
9709 __pyx_t_5 = 0;
9710 __Pyx_XDECREF_SET(__pyx_v_other, __pyx_t_6);
9711 __pyx_t_6 = 0;
9712
9713 /* "pygame_sdl2/rect.pyx":362
9714 * ret = []
9715 * for n, other in zip(range(len(other_list)), other_list):
9716 * if self.colliderect(other): # <<<<<<<<<<<<<<
9717 * ret.append(n)
9718 * return ret
9719 */
9720 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error)
9721 __Pyx_GOTREF(__pyx_t_6);
9722 __pyx_t_5 = NULL;
9723 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
9724 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
9725 if (likely(__pyx_t_5)) {
9726 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
9727 __Pyx_INCREF(__pyx_t_5);
9728 __Pyx_INCREF(function);
9729 __Pyx_DECREF_SET(__pyx_t_6, function);
9730 }
9731 }
9732 __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_other) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_other);
9733 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9734 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 362, __pyx_L1_error)
9735 __Pyx_GOTREF(__pyx_t_3);
9736 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
9737 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 362, __pyx_L1_error)
9738 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9739 if (__pyx_t_9) {
9740
9741 /* "pygame_sdl2/rect.pyx":363
9742 * for n, other in zip(range(len(other_list)), other_list):
9743 * if self.colliderect(other):
9744 * ret.append(n) # <<<<<<<<<<<<<<
9745 * return ret
9746 *
9747 */
9748 __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_v_n); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 363, __pyx_L1_error)
9749
9750 /* "pygame_sdl2/rect.pyx":362
9751 * ret = []
9752 * for n, other in zip(range(len(other_list)), other_list):
9753 * if self.colliderect(other): # <<<<<<<<<<<<<<
9754 * ret.append(n)
9755 * return ret
9756 */
9757 }
9758
9759 /* "pygame_sdl2/rect.pyx":361
9760 * def collidelistall(self, other_list):
9761 * ret = []
9762 * for n, other in zip(range(len(other_list)), other_list): # <<<<<<<<<<<<<<
9763 * if self.colliderect(other):
9764 * ret.append(n)
9765 */
9766 }
9767 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9768
9769 /* "pygame_sdl2/rect.pyx":364
9770 * if self.colliderect(other):
9771 * ret.append(n)
9772 * return ret # <<<<<<<<<<<<<<
9773 *
9774 * def collidedict(self, other_dict, rects_values=0):
9775 */
9776 __Pyx_XDECREF(__pyx_r);
9777 __Pyx_INCREF(__pyx_v_ret);
9778 __pyx_r = __pyx_v_ret;
9779 goto __pyx_L0;
9780
9781 /* "pygame_sdl2/rect.pyx":359
9782 * return -1
9783 *
9784 * def collidelistall(self, other_list): # <<<<<<<<<<<<<<
9785 * ret = []
9786 * for n, other in zip(range(len(other_list)), other_list):
9787 */
9788
9789 /* function exit code */
9790 __pyx_L1_error:;
9791 __Pyx_XDECREF(__pyx_t_1);
9792 __Pyx_XDECREF(__pyx_t_3);
9793 __Pyx_XDECREF(__pyx_t_5);
9794 __Pyx_XDECREF(__pyx_t_6);
9795 __Pyx_XDECREF(__pyx_t_7);
9796 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidelistall", __pyx_clineno, __pyx_lineno, __pyx_filename);
9797 __pyx_r = NULL;
9798 __pyx_L0:;
9799 __Pyx_XDECREF(__pyx_v_ret);
9800 __Pyx_XDECREF(__pyx_v_n);
9801 __Pyx_XDECREF(__pyx_v_other);
9802 __Pyx_XGIVEREF(__pyx_r);
9803 __Pyx_RefNannyFinishContext();
9804 return __pyx_r;
9805 }
9806
9807 /* "pygame_sdl2/rect.pyx":366
9808 * return ret
9809 *
9810 * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<<
9811 * # What is rects_values supposed to do? Not in docs.
9812 * for key, val in other_dict.items():
9813 */
9814
9815 /* Python wrapper */
9816 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)9817 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9818 PyObject *__pyx_v_other_dict = 0;
9819 CYTHON_UNUSED PyObject *__pyx_v_rects_values = 0;
9820 int __pyx_lineno = 0;
9821 const char *__pyx_filename = NULL;
9822 int __pyx_clineno = 0;
9823 PyObject *__pyx_r = 0;
9824 __Pyx_RefNannyDeclarations
9825 __Pyx_RefNannySetupContext("collidedict (wrapper)", 0);
9826 {
9827 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_dict,&__pyx_n_s_rects_values,0};
9828 PyObject* values[2] = {0,0};
9829 values[1] = ((PyObject *)__pyx_int_0);
9830 if (unlikely(__pyx_kwds)) {
9831 Py_ssize_t kw_args;
9832 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9833 switch (pos_args) {
9834 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9835 CYTHON_FALLTHROUGH;
9836 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9837 CYTHON_FALLTHROUGH;
9838 case 0: break;
9839 default: goto __pyx_L5_argtuple_error;
9840 }
9841 kw_args = PyDict_Size(__pyx_kwds);
9842 switch (pos_args) {
9843 case 0:
9844 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--;
9845 else goto __pyx_L5_argtuple_error;
9846 CYTHON_FALLTHROUGH;
9847 case 1:
9848 if (kw_args > 0) {
9849 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rects_values);
9850 if (value) { values[1] = value; kw_args--; }
9851 }
9852 }
9853 if (unlikely(kw_args > 0)) {
9854 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collidedict") < 0)) __PYX_ERR(0, 366, __pyx_L3_error)
9855 }
9856 } else {
9857 switch (PyTuple_GET_SIZE(__pyx_args)) {
9858 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9859 CYTHON_FALLTHROUGH;
9860 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9861 break;
9862 default: goto __pyx_L5_argtuple_error;
9863 }
9864 }
9865 __pyx_v_other_dict = values[0];
9866 __pyx_v_rects_values = values[1];
9867 }
9868 goto __pyx_L4_argument_unpacking_done;
9869 __pyx_L5_argtuple_error:;
9870 __Pyx_RaiseArgtupleInvalid("collidedict", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 366, __pyx_L3_error)
9871 __pyx_L3_error:;
9872 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedict", __pyx_clineno, __pyx_lineno, __pyx_filename);
9873 __Pyx_RefNannyFinishContext();
9874 return NULL;
9875 __pyx_L4_argument_unpacking_done:;
9876 __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);
9877
9878 /* function exit code */
9879 __Pyx_RefNannyFinishContext();
9880 return __pyx_r;
9881 }
9882
__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)9883 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) {
9884 PyObject *__pyx_v_key = NULL;
9885 PyObject *__pyx_v_val = NULL;
9886 PyObject *__pyx_r = NULL;
9887 __Pyx_RefNannyDeclarations
9888 PyObject *__pyx_t_1 = NULL;
9889 PyObject *__pyx_t_2 = NULL;
9890 PyObject *__pyx_t_3 = NULL;
9891 Py_ssize_t __pyx_t_4;
9892 PyObject *(*__pyx_t_5)(PyObject *);
9893 PyObject *__pyx_t_6 = NULL;
9894 PyObject *__pyx_t_7 = NULL;
9895 PyObject *(*__pyx_t_8)(PyObject *);
9896 int __pyx_t_9;
9897 int __pyx_lineno = 0;
9898 const char *__pyx_filename = NULL;
9899 int __pyx_clineno = 0;
9900 __Pyx_RefNannySetupContext("collidedict", 0);
9901
9902 /* "pygame_sdl2/rect.pyx":368
9903 * def collidedict(self, other_dict, rects_values=0):
9904 * # What is rects_values supposed to do? Not in docs.
9905 * for key, val in other_dict.items(): # <<<<<<<<<<<<<<
9906 * if self.colliderect(val):
9907 * return key, val
9908 */
9909 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other_dict, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
9910 __Pyx_GOTREF(__pyx_t_2);
9911 __pyx_t_3 = NULL;
9912 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
9913 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
9914 if (likely(__pyx_t_3)) {
9915 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9916 __Pyx_INCREF(__pyx_t_3);
9917 __Pyx_INCREF(function);
9918 __Pyx_DECREF_SET(__pyx_t_2, function);
9919 }
9920 }
9921 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
9922 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
9923 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
9924 __Pyx_GOTREF(__pyx_t_1);
9925 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9926 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
9927 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
9928 __pyx_t_5 = NULL;
9929 } else {
9930 __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error)
9931 __Pyx_GOTREF(__pyx_t_2);
9932 __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error)
9933 }
9934 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9935 for (;;) {
9936 if (likely(!__pyx_t_5)) {
9937 if (likely(PyList_CheckExact(__pyx_t_2))) {
9938 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
9939 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9940 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
9941 #else
9942 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
9943 __Pyx_GOTREF(__pyx_t_1);
9944 #endif
9945 } else {
9946 if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
9947 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9948 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
9949 #else
9950 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
9951 __Pyx_GOTREF(__pyx_t_1);
9952 #endif
9953 }
9954 } else {
9955 __pyx_t_1 = __pyx_t_5(__pyx_t_2);
9956 if (unlikely(!__pyx_t_1)) {
9957 PyObject* exc_type = PyErr_Occurred();
9958 if (exc_type) {
9959 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9960 else __PYX_ERR(0, 368, __pyx_L1_error)
9961 }
9962 break;
9963 }
9964 __Pyx_GOTREF(__pyx_t_1);
9965 }
9966 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
9967 PyObject* sequence = __pyx_t_1;
9968 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
9969 if (unlikely(size != 2)) {
9970 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
9971 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
9972 __PYX_ERR(0, 368, __pyx_L1_error)
9973 }
9974 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9975 if (likely(PyTuple_CheckExact(sequence))) {
9976 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
9977 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
9978 } else {
9979 __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
9980 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
9981 }
9982 __Pyx_INCREF(__pyx_t_3);
9983 __Pyx_INCREF(__pyx_t_6);
9984 #else
9985 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 368, __pyx_L1_error)
9986 __Pyx_GOTREF(__pyx_t_3);
9987 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 368, __pyx_L1_error)
9988 __Pyx_GOTREF(__pyx_t_6);
9989 #endif
9990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9991 } else {
9992 Py_ssize_t index = -1;
9993 __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 368, __pyx_L1_error)
9994 __Pyx_GOTREF(__pyx_t_7);
9995 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9996 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
9997 index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
9998 __Pyx_GOTREF(__pyx_t_3);
9999 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
10000 __Pyx_GOTREF(__pyx_t_6);
10001 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 368, __pyx_L1_error)
10002 __pyx_t_8 = NULL;
10003 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10004 goto __pyx_L6_unpacking_done;
10005 __pyx_L5_unpacking_failed:;
10006 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10007 __pyx_t_8 = NULL;
10008 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
10009 __PYX_ERR(0, 368, __pyx_L1_error)
10010 __pyx_L6_unpacking_done:;
10011 }
10012 __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
10013 __pyx_t_3 = 0;
10014 __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6);
10015 __pyx_t_6 = 0;
10016
10017 /* "pygame_sdl2/rect.pyx":369
10018 * # What is rects_values supposed to do? Not in docs.
10019 * for key, val in other_dict.items():
10020 * if self.colliderect(val): # <<<<<<<<<<<<<<
10021 * return key, val
10022 * return None
10023 */
10024 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 369, __pyx_L1_error)
10025 __Pyx_GOTREF(__pyx_t_6);
10026 __pyx_t_3 = NULL;
10027 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10028 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
10029 if (likely(__pyx_t_3)) {
10030 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10031 __Pyx_INCREF(__pyx_t_3);
10032 __Pyx_INCREF(function);
10033 __Pyx_DECREF_SET(__pyx_t_6, function);
10034 }
10035 }
10036 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_val);
10037 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10038 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
10039 __Pyx_GOTREF(__pyx_t_1);
10040 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10041 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 369, __pyx_L1_error)
10042 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10043 if (__pyx_t_9) {
10044
10045 /* "pygame_sdl2/rect.pyx":370
10046 * for key, val in other_dict.items():
10047 * if self.colliderect(val):
10048 * return key, val # <<<<<<<<<<<<<<
10049 * return None
10050 *
10051 */
10052 __Pyx_XDECREF(__pyx_r);
10053 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
10054 __Pyx_GOTREF(__pyx_t_1);
10055 __Pyx_INCREF(__pyx_v_key);
10056 __Pyx_GIVEREF(__pyx_v_key);
10057 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
10058 __Pyx_INCREF(__pyx_v_val);
10059 __Pyx_GIVEREF(__pyx_v_val);
10060 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_val);
10061 __pyx_r = __pyx_t_1;
10062 __pyx_t_1 = 0;
10063 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10064 goto __pyx_L0;
10065
10066 /* "pygame_sdl2/rect.pyx":369
10067 * # What is rects_values supposed to do? Not in docs.
10068 * for key, val in other_dict.items():
10069 * if self.colliderect(val): # <<<<<<<<<<<<<<
10070 * return key, val
10071 * return None
10072 */
10073 }
10074
10075 /* "pygame_sdl2/rect.pyx":368
10076 * def collidedict(self, other_dict, rects_values=0):
10077 * # What is rects_values supposed to do? Not in docs.
10078 * for key, val in other_dict.items(): # <<<<<<<<<<<<<<
10079 * if self.colliderect(val):
10080 * return key, val
10081 */
10082 }
10083 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10084
10085 /* "pygame_sdl2/rect.pyx":371
10086 * if self.colliderect(val):
10087 * return key, val
10088 * return None # <<<<<<<<<<<<<<
10089 *
10090 * def collidedictall(self, other_dict, rects_values=0):
10091 */
10092 __Pyx_XDECREF(__pyx_r);
10093 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10094 goto __pyx_L0;
10095
10096 /* "pygame_sdl2/rect.pyx":366
10097 * return ret
10098 *
10099 * def collidedict(self, other_dict, rects_values=0): # <<<<<<<<<<<<<<
10100 * # What is rects_values supposed to do? Not in docs.
10101 * for key, val in other_dict.items():
10102 */
10103
10104 /* function exit code */
10105 __pyx_L1_error:;
10106 __Pyx_XDECREF(__pyx_t_1);
10107 __Pyx_XDECREF(__pyx_t_2);
10108 __Pyx_XDECREF(__pyx_t_3);
10109 __Pyx_XDECREF(__pyx_t_6);
10110 __Pyx_XDECREF(__pyx_t_7);
10111 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedict", __pyx_clineno, __pyx_lineno, __pyx_filename);
10112 __pyx_r = NULL;
10113 __pyx_L0:;
10114 __Pyx_XDECREF(__pyx_v_key);
10115 __Pyx_XDECREF(__pyx_v_val);
10116 __Pyx_XGIVEREF(__pyx_r);
10117 __Pyx_RefNannyFinishContext();
10118 return __pyx_r;
10119 }
10120
10121 /* "pygame_sdl2/rect.pyx":373
10122 * return None
10123 *
10124 * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<<
10125 * ret = []
10126 * for key, val in other_dict.items():
10127 */
10128
10129 /* Python wrapper */
10130 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)10131 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10132 PyObject *__pyx_v_other_dict = 0;
10133 CYTHON_UNUSED PyObject *__pyx_v_rects_values = 0;
10134 int __pyx_lineno = 0;
10135 const char *__pyx_filename = NULL;
10136 int __pyx_clineno = 0;
10137 PyObject *__pyx_r = 0;
10138 __Pyx_RefNannyDeclarations
10139 __Pyx_RefNannySetupContext("collidedictall (wrapper)", 0);
10140 {
10141 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other_dict,&__pyx_n_s_rects_values,0};
10142 PyObject* values[2] = {0,0};
10143 values[1] = ((PyObject *)__pyx_int_0);
10144 if (unlikely(__pyx_kwds)) {
10145 Py_ssize_t kw_args;
10146 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10147 switch (pos_args) {
10148 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10149 CYTHON_FALLTHROUGH;
10150 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10151 CYTHON_FALLTHROUGH;
10152 case 0: break;
10153 default: goto __pyx_L5_argtuple_error;
10154 }
10155 kw_args = PyDict_Size(__pyx_kwds);
10156 switch (pos_args) {
10157 case 0:
10158 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other_dict)) != 0)) kw_args--;
10159 else goto __pyx_L5_argtuple_error;
10160 CYTHON_FALLTHROUGH;
10161 case 1:
10162 if (kw_args > 0) {
10163 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_rects_values);
10164 if (value) { values[1] = value; kw_args--; }
10165 }
10166 }
10167 if (unlikely(kw_args > 0)) {
10168 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collidedictall") < 0)) __PYX_ERR(0, 373, __pyx_L3_error)
10169 }
10170 } else {
10171 switch (PyTuple_GET_SIZE(__pyx_args)) {
10172 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10173 CYTHON_FALLTHROUGH;
10174 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10175 break;
10176 default: goto __pyx_L5_argtuple_error;
10177 }
10178 }
10179 __pyx_v_other_dict = values[0];
10180 __pyx_v_rects_values = values[1];
10181 }
10182 goto __pyx_L4_argument_unpacking_done;
10183 __pyx_L5_argtuple_error:;
10184 __Pyx_RaiseArgtupleInvalid("collidedictall", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 373, __pyx_L3_error)
10185 __pyx_L3_error:;
10186 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedictall", __pyx_clineno, __pyx_lineno, __pyx_filename);
10187 __Pyx_RefNannyFinishContext();
10188 return NULL;
10189 __pyx_L4_argument_unpacking_done:;
10190 __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);
10191
10192 /* function exit code */
10193 __Pyx_RefNannyFinishContext();
10194 return __pyx_r;
10195 }
10196
__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)10197 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) {
10198 PyObject *__pyx_v_ret = NULL;
10199 PyObject *__pyx_v_key = NULL;
10200 PyObject *__pyx_v_val = NULL;
10201 PyObject *__pyx_r = NULL;
10202 __Pyx_RefNannyDeclarations
10203 PyObject *__pyx_t_1 = NULL;
10204 PyObject *__pyx_t_2 = NULL;
10205 PyObject *__pyx_t_3 = NULL;
10206 Py_ssize_t __pyx_t_4;
10207 PyObject *(*__pyx_t_5)(PyObject *);
10208 PyObject *__pyx_t_6 = NULL;
10209 PyObject *__pyx_t_7 = NULL;
10210 PyObject *(*__pyx_t_8)(PyObject *);
10211 int __pyx_t_9;
10212 int __pyx_t_10;
10213 int __pyx_lineno = 0;
10214 const char *__pyx_filename = NULL;
10215 int __pyx_clineno = 0;
10216 __Pyx_RefNannySetupContext("collidedictall", 0);
10217
10218 /* "pygame_sdl2/rect.pyx":374
10219 *
10220 * def collidedictall(self, other_dict, rects_values=0):
10221 * ret = [] # <<<<<<<<<<<<<<
10222 * for key, val in other_dict.items():
10223 * if self.colliderect(val):
10224 */
10225 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error)
10226 __Pyx_GOTREF(__pyx_t_1);
10227 __pyx_v_ret = ((PyObject*)__pyx_t_1);
10228 __pyx_t_1 = 0;
10229
10230 /* "pygame_sdl2/rect.pyx":375
10231 * def collidedictall(self, other_dict, rects_values=0):
10232 * ret = []
10233 * for key, val in other_dict.items(): # <<<<<<<<<<<<<<
10234 * if self.colliderect(val):
10235 * ret.append((key,val))
10236 */
10237 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_other_dict, __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
10238 __Pyx_GOTREF(__pyx_t_2);
10239 __pyx_t_3 = NULL;
10240 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
10241 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
10242 if (likely(__pyx_t_3)) {
10243 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
10244 __Pyx_INCREF(__pyx_t_3);
10245 __Pyx_INCREF(function);
10246 __Pyx_DECREF_SET(__pyx_t_2, function);
10247 }
10248 }
10249 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
10250 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10251 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
10252 __Pyx_GOTREF(__pyx_t_1);
10253 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10254 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
10255 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
10256 __pyx_t_5 = NULL;
10257 } else {
10258 __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error)
10259 __Pyx_GOTREF(__pyx_t_2);
10260 __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error)
10261 }
10262 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10263 for (;;) {
10264 if (likely(!__pyx_t_5)) {
10265 if (likely(PyList_CheckExact(__pyx_t_2))) {
10266 if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
10267 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10268 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 375, __pyx_L1_error)
10269 #else
10270 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
10271 __Pyx_GOTREF(__pyx_t_1);
10272 #endif
10273 } else {
10274 if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10275 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10276 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 375, __pyx_L1_error)
10277 #else
10278 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error)
10279 __Pyx_GOTREF(__pyx_t_1);
10280 #endif
10281 }
10282 } else {
10283 __pyx_t_1 = __pyx_t_5(__pyx_t_2);
10284 if (unlikely(!__pyx_t_1)) {
10285 PyObject* exc_type = PyErr_Occurred();
10286 if (exc_type) {
10287 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10288 else __PYX_ERR(0, 375, __pyx_L1_error)
10289 }
10290 break;
10291 }
10292 __Pyx_GOTREF(__pyx_t_1);
10293 }
10294 if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
10295 PyObject* sequence = __pyx_t_1;
10296 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10297 if (unlikely(size != 2)) {
10298 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10299 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10300 __PYX_ERR(0, 375, __pyx_L1_error)
10301 }
10302 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10303 if (likely(PyTuple_CheckExact(sequence))) {
10304 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10305 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
10306 } else {
10307 __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
10308 __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
10309 }
10310 __Pyx_INCREF(__pyx_t_3);
10311 __Pyx_INCREF(__pyx_t_6);
10312 #else
10313 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 375, __pyx_L1_error)
10314 __Pyx_GOTREF(__pyx_t_3);
10315 __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 375, __pyx_L1_error)
10316 __Pyx_GOTREF(__pyx_t_6);
10317 #endif
10318 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10319 } else {
10320 Py_ssize_t index = -1;
10321 __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 375, __pyx_L1_error)
10322 __Pyx_GOTREF(__pyx_t_7);
10323 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10324 __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
10325 index = 0; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
10326 __Pyx_GOTREF(__pyx_t_3);
10327 index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
10328 __Pyx_GOTREF(__pyx_t_6);
10329 if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 375, __pyx_L1_error)
10330 __pyx_t_8 = NULL;
10331 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10332 goto __pyx_L6_unpacking_done;
10333 __pyx_L5_unpacking_failed:;
10334 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10335 __pyx_t_8 = NULL;
10336 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
10337 __PYX_ERR(0, 375, __pyx_L1_error)
10338 __pyx_L6_unpacking_done:;
10339 }
10340 __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
10341 __pyx_t_3 = 0;
10342 __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6);
10343 __pyx_t_6 = 0;
10344
10345 /* "pygame_sdl2/rect.pyx":376
10346 * ret = []
10347 * for key, val in other_dict.items():
10348 * if self.colliderect(val): # <<<<<<<<<<<<<<
10349 * ret.append((key,val))
10350 * return ret
10351 */
10352 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_colliderect); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error)
10353 __Pyx_GOTREF(__pyx_t_6);
10354 __pyx_t_3 = NULL;
10355 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
10356 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
10357 if (likely(__pyx_t_3)) {
10358 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
10359 __Pyx_INCREF(__pyx_t_3);
10360 __Pyx_INCREF(function);
10361 __Pyx_DECREF_SET(__pyx_t_6, function);
10362 }
10363 }
10364 __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_3, __pyx_v_val) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_val);
10365 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10366 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
10367 __Pyx_GOTREF(__pyx_t_1);
10368 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10369 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
10370 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10371 if (__pyx_t_9) {
10372
10373 /* "pygame_sdl2/rect.pyx":377
10374 * for key, val in other_dict.items():
10375 * if self.colliderect(val):
10376 * ret.append((key,val)) # <<<<<<<<<<<<<<
10377 * return ret
10378 *
10379 */
10380 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
10381 __Pyx_GOTREF(__pyx_t_1);
10382 __Pyx_INCREF(__pyx_v_key);
10383 __Pyx_GIVEREF(__pyx_v_key);
10384 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_key);
10385 __Pyx_INCREF(__pyx_v_val);
10386 __Pyx_GIVEREF(__pyx_v_val);
10387 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_val);
10388 __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_ret, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 377, __pyx_L1_error)
10389 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10390
10391 /* "pygame_sdl2/rect.pyx":376
10392 * ret = []
10393 * for key, val in other_dict.items():
10394 * if self.colliderect(val): # <<<<<<<<<<<<<<
10395 * ret.append((key,val))
10396 * return ret
10397 */
10398 }
10399
10400 /* "pygame_sdl2/rect.pyx":375
10401 * def collidedictall(self, other_dict, rects_values=0):
10402 * ret = []
10403 * for key, val in other_dict.items(): # <<<<<<<<<<<<<<
10404 * if self.colliderect(val):
10405 * ret.append((key,val))
10406 */
10407 }
10408 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10409
10410 /* "pygame_sdl2/rect.pyx":378
10411 * if self.colliderect(val):
10412 * ret.append((key,val))
10413 * return ret # <<<<<<<<<<<<<<
10414 *
10415 *
10416 */
10417 __Pyx_XDECREF(__pyx_r);
10418 __Pyx_INCREF(__pyx_v_ret);
10419 __pyx_r = __pyx_v_ret;
10420 goto __pyx_L0;
10421
10422 /* "pygame_sdl2/rect.pyx":373
10423 * return None
10424 *
10425 * def collidedictall(self, other_dict, rects_values=0): # <<<<<<<<<<<<<<
10426 * ret = []
10427 * for key, val in other_dict.items():
10428 */
10429
10430 /* function exit code */
10431 __pyx_L1_error:;
10432 __Pyx_XDECREF(__pyx_t_1);
10433 __Pyx_XDECREF(__pyx_t_2);
10434 __Pyx_XDECREF(__pyx_t_3);
10435 __Pyx_XDECREF(__pyx_t_6);
10436 __Pyx_XDECREF(__pyx_t_7);
10437 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.collidedictall", __pyx_clineno, __pyx_lineno, __pyx_filename);
10438 __pyx_r = NULL;
10439 __pyx_L0:;
10440 __Pyx_XDECREF(__pyx_v_ret);
10441 __Pyx_XDECREF(__pyx_v_key);
10442 __Pyx_XDECREF(__pyx_v_val);
10443 __Pyx_XGIVEREF(__pyx_r);
10444 __Pyx_RefNannyFinishContext();
10445 return __pyx_r;
10446 }
10447
10448 /* "pygame_sdl2/rect.pxd":25
10449 * cdef object __weakref__
10450 *
10451 * cdef public int x # <<<<<<<<<<<<<<
10452 * cdef public int y
10453 * cdef public int w
10454 */
10455
10456 /* Python wrapper */
10457 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject * __pyx_v_self)10458 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(PyObject *__pyx_v_self) {
10459 PyObject *__pyx_r = 0;
10460 __Pyx_RefNannyDeclarations
10461 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10462 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
10463
10464 /* function exit code */
10465 __Pyx_RefNannyFinishContext();
10466 return __pyx_r;
10467 }
10468
__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)10469 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1x___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
10470 PyObject *__pyx_r = NULL;
10471 __Pyx_RefNannyDeclarations
10472 PyObject *__pyx_t_1 = NULL;
10473 int __pyx_lineno = 0;
10474 const char *__pyx_filename = NULL;
10475 int __pyx_clineno = 0;
10476 __Pyx_RefNannySetupContext("__get__", 0);
10477 __Pyx_XDECREF(__pyx_r);
10478 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 25, __pyx_L1_error)
10479 __Pyx_GOTREF(__pyx_t_1);
10480 __pyx_r = __pyx_t_1;
10481 __pyx_t_1 = 0;
10482 goto __pyx_L0;
10483
10484 /* function exit code */
10485 __pyx_L1_error:;
10486 __Pyx_XDECREF(__pyx_t_1);
10487 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10488 __pyx_r = NULL;
10489 __pyx_L0:;
10490 __Pyx_XGIVEREF(__pyx_r);
10491 __Pyx_RefNannyFinishContext();
10492 return __pyx_r;
10493 }
10494
10495 /* Python wrapper */
10496 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)10497 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10498 int __pyx_r;
10499 __Pyx_RefNannyDeclarations
10500 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10501 __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));
10502
10503 /* function exit code */
10504 __Pyx_RefNannyFinishContext();
10505 return __pyx_r;
10506 }
10507
__pyx_pf_11pygame_sdl2_4rect_4Rect_1x_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_value)10508 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) {
10509 int __pyx_r;
10510 __Pyx_RefNannyDeclarations
10511 int __pyx_t_1;
10512 int __pyx_lineno = 0;
10513 const char *__pyx_filename = NULL;
10514 int __pyx_clineno = 0;
10515 __Pyx_RefNannySetupContext("__set__", 0);
10516 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 25, __pyx_L1_error)
10517 __pyx_v_self->x = __pyx_t_1;
10518
10519 /* function exit code */
10520 __pyx_r = 0;
10521 goto __pyx_L0;
10522 __pyx_L1_error:;
10523 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.x.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10524 __pyx_r = -1;
10525 __pyx_L0:;
10526 __Pyx_RefNannyFinishContext();
10527 return __pyx_r;
10528 }
10529
10530 /* "pygame_sdl2/rect.pxd":26
10531 *
10532 * cdef public int x
10533 * cdef public int y # <<<<<<<<<<<<<<
10534 * cdef public int w
10535 * cdef public int h
10536 */
10537
10538 /* Python wrapper */
10539 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject * __pyx_v_self)10540 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(PyObject *__pyx_v_self) {
10541 PyObject *__pyx_r = 0;
10542 __Pyx_RefNannyDeclarations
10543 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10544 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
10545
10546 /* function exit code */
10547 __Pyx_RefNannyFinishContext();
10548 return __pyx_r;
10549 }
10550
__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)10551 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1y___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
10552 PyObject *__pyx_r = NULL;
10553 __Pyx_RefNannyDeclarations
10554 PyObject *__pyx_t_1 = NULL;
10555 int __pyx_lineno = 0;
10556 const char *__pyx_filename = NULL;
10557 int __pyx_clineno = 0;
10558 __Pyx_RefNannySetupContext("__get__", 0);
10559 __Pyx_XDECREF(__pyx_r);
10560 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 26, __pyx_L1_error)
10561 __Pyx_GOTREF(__pyx_t_1);
10562 __pyx_r = __pyx_t_1;
10563 __pyx_t_1 = 0;
10564 goto __pyx_L0;
10565
10566 /* function exit code */
10567 __pyx_L1_error:;
10568 __Pyx_XDECREF(__pyx_t_1);
10569 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.y.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10570 __pyx_r = NULL;
10571 __pyx_L0:;
10572 __Pyx_XGIVEREF(__pyx_r);
10573 __Pyx_RefNannyFinishContext();
10574 return __pyx_r;
10575 }
10576
10577 /* Python wrapper */
10578 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)10579 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10580 int __pyx_r;
10581 __Pyx_RefNannyDeclarations
10582 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10583 __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));
10584
10585 /* function exit code */
10586 __Pyx_RefNannyFinishContext();
10587 return __pyx_r;
10588 }
10589
__pyx_pf_11pygame_sdl2_4rect_4Rect_1y_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_value)10590 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) {
10591 int __pyx_r;
10592 __Pyx_RefNannyDeclarations
10593 int __pyx_t_1;
10594 int __pyx_lineno = 0;
10595 const char *__pyx_filename = NULL;
10596 int __pyx_clineno = 0;
10597 __Pyx_RefNannySetupContext("__set__", 0);
10598 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
10599 __pyx_v_self->y = __pyx_t_1;
10600
10601 /* function exit code */
10602 __pyx_r = 0;
10603 goto __pyx_L0;
10604 __pyx_L1_error:;
10605 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.y.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10606 __pyx_r = -1;
10607 __pyx_L0:;
10608 __Pyx_RefNannyFinishContext();
10609 return __pyx_r;
10610 }
10611
10612 /* "pygame_sdl2/rect.pxd":27
10613 * cdef public int x
10614 * cdef public int y
10615 * cdef public int w # <<<<<<<<<<<<<<
10616 * cdef public int h
10617 *
10618 */
10619
10620 /* Python wrapper */
10621 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject * __pyx_v_self)10622 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(PyObject *__pyx_v_self) {
10623 PyObject *__pyx_r = 0;
10624 __Pyx_RefNannyDeclarations
10625 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10626 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
10627
10628 /* function exit code */
10629 __Pyx_RefNannyFinishContext();
10630 return __pyx_r;
10631 }
10632
__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)10633 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1w___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
10634 PyObject *__pyx_r = NULL;
10635 __Pyx_RefNannyDeclarations
10636 PyObject *__pyx_t_1 = NULL;
10637 int __pyx_lineno = 0;
10638 const char *__pyx_filename = NULL;
10639 int __pyx_clineno = 0;
10640 __Pyx_RefNannySetupContext("__get__", 0);
10641 __Pyx_XDECREF(__pyx_r);
10642 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->w); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 27, __pyx_L1_error)
10643 __Pyx_GOTREF(__pyx_t_1);
10644 __pyx_r = __pyx_t_1;
10645 __pyx_t_1 = 0;
10646 goto __pyx_L0;
10647
10648 /* function exit code */
10649 __pyx_L1_error:;
10650 __Pyx_XDECREF(__pyx_t_1);
10651 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.w.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10652 __pyx_r = NULL;
10653 __pyx_L0:;
10654 __Pyx_XGIVEREF(__pyx_r);
10655 __Pyx_RefNannyFinishContext();
10656 return __pyx_r;
10657 }
10658
10659 /* Python wrapper */
10660 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)10661 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10662 int __pyx_r;
10663 __Pyx_RefNannyDeclarations
10664 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10665 __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));
10666
10667 /* function exit code */
10668 __Pyx_RefNannyFinishContext();
10669 return __pyx_r;
10670 }
10671
__pyx_pf_11pygame_sdl2_4rect_4Rect_1w_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_value)10672 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) {
10673 int __pyx_r;
10674 __Pyx_RefNannyDeclarations
10675 int __pyx_t_1;
10676 int __pyx_lineno = 0;
10677 const char *__pyx_filename = NULL;
10678 int __pyx_clineno = 0;
10679 __Pyx_RefNannySetupContext("__set__", 0);
10680 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 27, __pyx_L1_error)
10681 __pyx_v_self->w = __pyx_t_1;
10682
10683 /* function exit code */
10684 __pyx_r = 0;
10685 goto __pyx_L0;
10686 __pyx_L1_error:;
10687 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.w.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10688 __pyx_r = -1;
10689 __pyx_L0:;
10690 __Pyx_RefNannyFinishContext();
10691 return __pyx_r;
10692 }
10693
10694 /* "pygame_sdl2/rect.pxd":28
10695 * cdef public int y
10696 * cdef public int w
10697 * cdef public int h # <<<<<<<<<<<<<<
10698 *
10699 *
10700 */
10701
10702 /* Python wrapper */
10703 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject * __pyx_v_self)10704 static PyObject *__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(PyObject *__pyx_v_self) {
10705 PyObject *__pyx_r = 0;
10706 __Pyx_RefNannyDeclarations
10707 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10708 __pyx_r = __pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_v_self));
10709
10710 /* function exit code */
10711 __Pyx_RefNannyFinishContext();
10712 return __pyx_r;
10713 }
10714
__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self)10715 static PyObject *__pyx_pf_11pygame_sdl2_4rect_4Rect_1h___get__(struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_self) {
10716 PyObject *__pyx_r = NULL;
10717 __Pyx_RefNannyDeclarations
10718 PyObject *__pyx_t_1 = NULL;
10719 int __pyx_lineno = 0;
10720 const char *__pyx_filename = NULL;
10721 int __pyx_clineno = 0;
10722 __Pyx_RefNannySetupContext("__get__", 0);
10723 __Pyx_XDECREF(__pyx_r);
10724 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->h); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 28, __pyx_L1_error)
10725 __Pyx_GOTREF(__pyx_t_1);
10726 __pyx_r = __pyx_t_1;
10727 __pyx_t_1 = 0;
10728 goto __pyx_L0;
10729
10730 /* function exit code */
10731 __pyx_L1_error:;
10732 __Pyx_XDECREF(__pyx_t_1);
10733 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.h.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10734 __pyx_r = NULL;
10735 __pyx_L0:;
10736 __Pyx_XGIVEREF(__pyx_r);
10737 __Pyx_RefNannyFinishContext();
10738 return __pyx_r;
10739 }
10740
10741 /* Python wrapper */
10742 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject * __pyx_v_self,PyObject * __pyx_v_value)10743 static int __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10744 int __pyx_r;
10745 __Pyx_RefNannyDeclarations
10746 __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10747 __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));
10748
10749 /* function exit code */
10750 __Pyx_RefNannyFinishContext();
10751 return __pyx_r;
10752 }
10753
__pyx_pf_11pygame_sdl2_4rect_4Rect_1h_2__set__(struct __pyx_obj_11pygame_sdl2_4rect_Rect * __pyx_v_self,PyObject * __pyx_v_value)10754 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) {
10755 int __pyx_r;
10756 __Pyx_RefNannyDeclarations
10757 int __pyx_t_1;
10758 int __pyx_lineno = 0;
10759 const char *__pyx_filename = NULL;
10760 int __pyx_clineno = 0;
10761 __Pyx_RefNannySetupContext("__set__", 0);
10762 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 28, __pyx_L1_error)
10763 __pyx_v_self->h = __pyx_t_1;
10764
10765 /* function exit code */
10766 __pyx_r = 0;
10767 goto __pyx_L0;
10768 __pyx_L1_error:;
10769 __Pyx_AddTraceback("pygame_sdl2.rect.Rect.h.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10770 __pyx_r = -1;
10771 __pyx_L0:;
10772 __Pyx_RefNannyFinishContext();
10773 return __pyx_r;
10774 }
10775
10776 /* "pygame_sdl2/rect.pyx":381
10777 *
10778 *
10779 * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: # <<<<<<<<<<<<<<
10780 * """
10781 * Converts `rectlike` to the SDL_Rect `rect`.
10782 */
10783
__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)10784 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) {
10785 PyObject *__pyx_v_argname = ((PyObject *)Py_None);
10786 struct __pyx_obj_11pygame_sdl2_4rect_Rect *__pyx_v_rl = 0;
10787 int __pyx_r;
10788 __Pyx_RefNannyDeclarations
10789 PyObject *__pyx_t_1 = NULL;
10790 PyObject *__pyx_t_2 = NULL;
10791 PyObject *__pyx_t_3 = NULL;
10792 int __pyx_t_4;
10793 int __pyx_t_5;
10794 PyObject *__pyx_t_6 = NULL;
10795 int __pyx_t_7;
10796 Py_ssize_t __pyx_t_8;
10797 PyObject *__pyx_t_9 = NULL;
10798 PyObject *__pyx_t_10 = NULL;
10799 PyObject *__pyx_t_11 = NULL;
10800 PyObject *__pyx_t_12 = NULL;
10801 PyObject *(*__pyx_t_13)(PyObject *);
10802 int __pyx_t_14;
10803 int __pyx_t_15;
10804 int __pyx_t_16;
10805 int __pyx_lineno = 0;
10806 const char *__pyx_filename = NULL;
10807 int __pyx_clineno = 0;
10808 __Pyx_RefNannySetupContext("to_sdl_rect", 0);
10809 if (__pyx_optional_args) {
10810 if (__pyx_optional_args->__pyx_n > 0) {
10811 __pyx_v_argname = __pyx_optional_args->argname;
10812 }
10813 }
10814
10815 /* "pygame_sdl2/rect.pyx":391
10816 * cdef Rect rl
10817 *
10818 * try: # <<<<<<<<<<<<<<
10819 * if isinstance(rectlike, Rect):
10820 * rl = rectlike
10821 */
10822 {
10823 __Pyx_PyThreadState_declare
10824 __Pyx_PyThreadState_assign
10825 __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
10826 __Pyx_XGOTREF(__pyx_t_1);
10827 __Pyx_XGOTREF(__pyx_t_2);
10828 __Pyx_XGOTREF(__pyx_t_3);
10829 /*try:*/ {
10830
10831 /* "pygame_sdl2/rect.pyx":392
10832 *
10833 * try:
10834 * if isinstance(rectlike, Rect): # <<<<<<<<<<<<<<
10835 * rl = rectlike
10836 *
10837 */
10838 __pyx_t_4 = __Pyx_TypeCheck(__pyx_v_rectlike, __pyx_ptype_11pygame_sdl2_4rect_Rect);
10839 __pyx_t_5 = (__pyx_t_4 != 0);
10840 if (__pyx_t_5) {
10841
10842 /* "pygame_sdl2/rect.pyx":393
10843 * try:
10844 * if isinstance(rectlike, Rect):
10845 * rl = rectlike # <<<<<<<<<<<<<<
10846 *
10847 * rect.x = rl.x
10848 */
10849 if (!(likely(((__pyx_v_rectlike) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_rectlike, __pyx_ptype_11pygame_sdl2_4rect_Rect))))) __PYX_ERR(0, 393, __pyx_L3_error)
10850 __pyx_t_6 = __pyx_v_rectlike;
10851 __Pyx_INCREF(__pyx_t_6);
10852 __pyx_v_rl = ((struct __pyx_obj_11pygame_sdl2_4rect_Rect *)__pyx_t_6);
10853 __pyx_t_6 = 0;
10854
10855 /* "pygame_sdl2/rect.pyx":395
10856 * rl = rectlike
10857 *
10858 * rect.x = rl.x # <<<<<<<<<<<<<<
10859 * rect.y = rl.y
10860 * rect.w = rl.w
10861 */
10862 __pyx_t_7 = __pyx_v_rl->x;
10863 __pyx_v_rect->x = __pyx_t_7;
10864
10865 /* "pygame_sdl2/rect.pyx":396
10866 *
10867 * rect.x = rl.x
10868 * rect.y = rl.y # <<<<<<<<<<<<<<
10869 * rect.w = rl.w
10870 * rect.h = rl.h
10871 */
10872 __pyx_t_7 = __pyx_v_rl->y;
10873 __pyx_v_rect->y = __pyx_t_7;
10874
10875 /* "pygame_sdl2/rect.pyx":397
10876 * rect.x = rl.x
10877 * rect.y = rl.y
10878 * rect.w = rl.w # <<<<<<<<<<<<<<
10879 * rect.h = rl.h
10880 *
10881 */
10882 __pyx_t_7 = __pyx_v_rl->w;
10883 __pyx_v_rect->w = __pyx_t_7;
10884
10885 /* "pygame_sdl2/rect.pyx":398
10886 * rect.y = rl.y
10887 * rect.w = rl.w
10888 * rect.h = rl.h # <<<<<<<<<<<<<<
10889 *
10890 * return 0
10891 */
10892 __pyx_t_7 = __pyx_v_rl->h;
10893 __pyx_v_rect->h = __pyx_t_7;
10894
10895 /* "pygame_sdl2/rect.pyx":400
10896 * rect.h = rl.h
10897 *
10898 * return 0 # <<<<<<<<<<<<<<
10899 *
10900 * elif len(rectlike) == 4:
10901 */
10902 __pyx_r = 0;
10903 goto __pyx_L7_try_return;
10904
10905 /* "pygame_sdl2/rect.pyx":392
10906 *
10907 * try:
10908 * if isinstance(rectlike, Rect): # <<<<<<<<<<<<<<
10909 * rl = rectlike
10910 *
10911 */
10912 }
10913
10914 /* "pygame_sdl2/rect.pyx":402
10915 * return 0
10916 *
10917 * elif len(rectlike) == 4: # <<<<<<<<<<<<<<
10918 * rect.x, rect.y, rect.w, rect.h = rectlike
10919 * return 0
10920 */
10921 __pyx_t_8 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 402, __pyx_L3_error)
10922 __pyx_t_5 = ((__pyx_t_8 == 4) != 0);
10923 if (__pyx_t_5) {
10924
10925 /* "pygame_sdl2/rect.pyx":403
10926 *
10927 * elif len(rectlike) == 4:
10928 * rect.x, rect.y, rect.w, rect.h = rectlike # <<<<<<<<<<<<<<
10929 * return 0
10930 *
10931 */
10932 if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) {
10933 PyObject* sequence = __pyx_v_rectlike;
10934 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10935 if (unlikely(size != 4)) {
10936 if (size > 4) __Pyx_RaiseTooManyValuesError(4);
10937 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10938 __PYX_ERR(0, 403, __pyx_L3_error)
10939 }
10940 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10941 if (likely(PyTuple_CheckExact(sequence))) {
10942 __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
10943 __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
10944 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2);
10945 __pyx_t_11 = PyTuple_GET_ITEM(sequence, 3);
10946 } else {
10947 __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
10948 __pyx_t_9 = PyList_GET_ITEM(sequence, 1);
10949 __pyx_t_10 = PyList_GET_ITEM(sequence, 2);
10950 __pyx_t_11 = PyList_GET_ITEM(sequence, 3);
10951 }
10952 __Pyx_INCREF(__pyx_t_6);
10953 __Pyx_INCREF(__pyx_t_9);
10954 __Pyx_INCREF(__pyx_t_10);
10955 __Pyx_INCREF(__pyx_t_11);
10956 #else
10957 {
10958 Py_ssize_t i;
10959 PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
10960 for (i=0; i < 4; i++) {
10961 PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 403, __pyx_L3_error)
10962 __Pyx_GOTREF(item);
10963 *(temps[i]) = item;
10964 }
10965 }
10966 #endif
10967 } else {
10968 Py_ssize_t index = -1;
10969 PyObject** temps[4] = {&__pyx_t_6,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
10970 __pyx_t_12 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 403, __pyx_L3_error)
10971 __Pyx_GOTREF(__pyx_t_12);
10972 __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
10973 for (index=0; index < 4; index++) {
10974 PyObject* item = __pyx_t_13(__pyx_t_12); if (unlikely(!item)) goto __pyx_L10_unpacking_failed;
10975 __Pyx_GOTREF(item);
10976 *(temps[index]) = item;
10977 }
10978 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 4) < 0) __PYX_ERR(0, 403, __pyx_L3_error)
10979 __pyx_t_13 = NULL;
10980 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10981 goto __pyx_L11_unpacking_done;
10982 __pyx_L10_unpacking_failed:;
10983 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
10984 __pyx_t_13 = NULL;
10985 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
10986 __PYX_ERR(0, 403, __pyx_L3_error)
10987 __pyx_L11_unpacking_done:;
10988 }
10989 __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error)
10990 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10991 __pyx_t_14 = __Pyx_PyInt_As_int(__pyx_t_9); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error)
10992 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
10993 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error)
10994 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
10995 __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 403, __pyx_L3_error)
10996 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
10997 __pyx_v_rect->x = __pyx_t_7;
10998 __pyx_v_rect->y = __pyx_t_14;
10999 __pyx_v_rect->w = __pyx_t_15;
11000 __pyx_v_rect->h = __pyx_t_16;
11001
11002 /* "pygame_sdl2/rect.pyx":404
11003 * elif len(rectlike) == 4:
11004 * rect.x, rect.y, rect.w, rect.h = rectlike
11005 * return 0 # <<<<<<<<<<<<<<
11006 *
11007 * elif len(rectlike) == 2:
11008 */
11009 __pyx_r = 0;
11010 goto __pyx_L7_try_return;
11011
11012 /* "pygame_sdl2/rect.pyx":402
11013 * return 0
11014 *
11015 * elif len(rectlike) == 4: # <<<<<<<<<<<<<<
11016 * rect.x, rect.y, rect.w, rect.h = rectlike
11017 * return 0
11018 */
11019 }
11020
11021 /* "pygame_sdl2/rect.pyx":406
11022 * return 0
11023 *
11024 * elif len(rectlike) == 2: # <<<<<<<<<<<<<<
11025 * rect.x, rect.y = rectlike
11026 * rect.w, rect.h = rectlike
11027 */
11028 __pyx_t_8 = PyObject_Length(__pyx_v_rectlike); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 406, __pyx_L3_error)
11029 __pyx_t_5 = ((__pyx_t_8 == 2) != 0);
11030 if (__pyx_t_5) {
11031
11032 /* "pygame_sdl2/rect.pyx":407
11033 *
11034 * elif len(rectlike) == 2:
11035 * rect.x, rect.y = rectlike # <<<<<<<<<<<<<<
11036 * rect.w, rect.h = rectlike
11037 * return 0
11038 */
11039 if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) {
11040 PyObject* sequence = __pyx_v_rectlike;
11041 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11042 if (unlikely(size != 2)) {
11043 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11044 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11045 __PYX_ERR(0, 407, __pyx_L3_error)
11046 }
11047 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11048 if (likely(PyTuple_CheckExact(sequence))) {
11049 __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0);
11050 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 1);
11051 } else {
11052 __pyx_t_11 = PyList_GET_ITEM(sequence, 0);
11053 __pyx_t_10 = PyList_GET_ITEM(sequence, 1);
11054 }
11055 __Pyx_INCREF(__pyx_t_11);
11056 __Pyx_INCREF(__pyx_t_10);
11057 #else
11058 __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 407, __pyx_L3_error)
11059 __Pyx_GOTREF(__pyx_t_11);
11060 __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 407, __pyx_L3_error)
11061 __Pyx_GOTREF(__pyx_t_10);
11062 #endif
11063 } else {
11064 Py_ssize_t index = -1;
11065 __pyx_t_9 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 407, __pyx_L3_error)
11066 __Pyx_GOTREF(__pyx_t_9);
11067 __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext;
11068 index = 0; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L12_unpacking_failed;
11069 __Pyx_GOTREF(__pyx_t_11);
11070 index = 1; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L12_unpacking_failed;
11071 __Pyx_GOTREF(__pyx_t_10);
11072 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) __PYX_ERR(0, 407, __pyx_L3_error)
11073 __pyx_t_13 = NULL;
11074 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11075 goto __pyx_L13_unpacking_done;
11076 __pyx_L12_unpacking_failed:;
11077 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11078 __pyx_t_13 = NULL;
11079 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
11080 __PYX_ERR(0, 407, __pyx_L3_error)
11081 __pyx_L13_unpacking_done:;
11082 }
11083 __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error)
11084 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11085 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 407, __pyx_L3_error)
11086 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11087 __pyx_v_rect->x = __pyx_t_16;
11088 __pyx_v_rect->y = __pyx_t_15;
11089
11090 /* "pygame_sdl2/rect.pyx":408
11091 * elif len(rectlike) == 2:
11092 * rect.x, rect.y = rectlike
11093 * rect.w, rect.h = rectlike # <<<<<<<<<<<<<<
11094 * return 0
11095 *
11096 */
11097 if ((likely(PyTuple_CheckExact(__pyx_v_rectlike))) || (PyList_CheckExact(__pyx_v_rectlike))) {
11098 PyObject* sequence = __pyx_v_rectlike;
11099 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11100 if (unlikely(size != 2)) {
11101 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11102 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11103 __PYX_ERR(0, 408, __pyx_L3_error)
11104 }
11105 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11106 if (likely(PyTuple_CheckExact(sequence))) {
11107 __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
11108 __pyx_t_11 = PyTuple_GET_ITEM(sequence, 1);
11109 } else {
11110 __pyx_t_10 = PyList_GET_ITEM(sequence, 0);
11111 __pyx_t_11 = PyList_GET_ITEM(sequence, 1);
11112 }
11113 __Pyx_INCREF(__pyx_t_10);
11114 __Pyx_INCREF(__pyx_t_11);
11115 #else
11116 __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 408, __pyx_L3_error)
11117 __Pyx_GOTREF(__pyx_t_10);
11118 __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 408, __pyx_L3_error)
11119 __Pyx_GOTREF(__pyx_t_11);
11120 #endif
11121 } else {
11122 Py_ssize_t index = -1;
11123 __pyx_t_9 = PyObject_GetIter(__pyx_v_rectlike); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 408, __pyx_L3_error)
11124 __Pyx_GOTREF(__pyx_t_9);
11125 __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext;
11126 index = 0; __pyx_t_10 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_10)) goto __pyx_L14_unpacking_failed;
11127 __Pyx_GOTREF(__pyx_t_10);
11128 index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_9); if (unlikely(!__pyx_t_11)) goto __pyx_L14_unpacking_failed;
11129 __Pyx_GOTREF(__pyx_t_11);
11130 if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_9), 2) < 0) __PYX_ERR(0, 408, __pyx_L3_error)
11131 __pyx_t_13 = NULL;
11132 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11133 goto __pyx_L15_unpacking_done;
11134 __pyx_L14_unpacking_failed:;
11135 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11136 __pyx_t_13 = NULL;
11137 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
11138 __PYX_ERR(0, 408, __pyx_L3_error)
11139 __pyx_L15_unpacking_done:;
11140 }
11141 __pyx_t_15 = __Pyx_PyInt_As_int(__pyx_t_10); if (unlikely((__pyx_t_15 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error)
11142 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11143 __pyx_t_16 = __Pyx_PyInt_As_int(__pyx_t_11); if (unlikely((__pyx_t_16 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 408, __pyx_L3_error)
11144 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11145 __pyx_v_rect->w = __pyx_t_15;
11146 __pyx_v_rect->h = __pyx_t_16;
11147
11148 /* "pygame_sdl2/rect.pyx":409
11149 * rect.x, rect.y = rectlike
11150 * rect.w, rect.h = rectlike
11151 * return 0 # <<<<<<<<<<<<<<
11152 *
11153 * except:
11154 */
11155 __pyx_r = 0;
11156 goto __pyx_L7_try_return;
11157
11158 /* "pygame_sdl2/rect.pyx":406
11159 * return 0
11160 *
11161 * elif len(rectlike) == 2: # <<<<<<<<<<<<<<
11162 * rect.x, rect.y = rectlike
11163 * rect.w, rect.h = rectlike
11164 */
11165 }
11166
11167 /* "pygame_sdl2/rect.pyx":391
11168 * cdef Rect rl
11169 *
11170 * try: # <<<<<<<<<<<<<<
11171 * if isinstance(rectlike, Rect):
11172 * rl = rectlike
11173 */
11174 }
11175 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11176 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11177 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11178 goto __pyx_L8_try_end;
11179 __pyx_L3_error:;
11180 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
11181 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
11182 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
11183 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11184 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11185
11186 /* "pygame_sdl2/rect.pyx":411
11187 * return 0
11188 *
11189 * except: # <<<<<<<<<<<<<<
11190 * pass
11191 *
11192 */
11193 /*except:*/ {
11194 __Pyx_ErrRestore(0,0,0);
11195 goto __pyx_L4_exception_handled;
11196 }
11197 __pyx_L7_try_return:;
11198
11199 /* "pygame_sdl2/rect.pyx":391
11200 * cdef Rect rl
11201 *
11202 * try: # <<<<<<<<<<<<<<
11203 * if isinstance(rectlike, Rect):
11204 * rl = rectlike
11205 */
11206 __Pyx_XGIVEREF(__pyx_t_1);
11207 __Pyx_XGIVEREF(__pyx_t_2);
11208 __Pyx_XGIVEREF(__pyx_t_3);
11209 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
11210 goto __pyx_L0;
11211 __pyx_L4_exception_handled:;
11212 __Pyx_XGIVEREF(__pyx_t_1);
11213 __Pyx_XGIVEREF(__pyx_t_2);
11214 __Pyx_XGIVEREF(__pyx_t_3);
11215 __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
11216 __pyx_L8_try_end:;
11217 }
11218
11219 /* "pygame_sdl2/rect.pyx":414
11220 * pass
11221 *
11222 * if argname: # <<<<<<<<<<<<<<
11223 * raise TypeError("Argument {} must be a rect style object.".format(argname))
11224 * else:
11225 */
11226 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_argname); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 414, __pyx_L1_error)
11227 if (unlikely(__pyx_t_5)) {
11228
11229 /* "pygame_sdl2/rect.pyx":415
11230 *
11231 * if argname:
11232 * raise TypeError("Argument {} must be a rect style object.".format(argname)) # <<<<<<<<<<<<<<
11233 * else:
11234 * raise TypeError("Argument must be a rect style object.")
11235 */
11236 __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_ERR(0, 415, __pyx_L1_error)
11237 __Pyx_GOTREF(__pyx_t_10);
11238 __pyx_t_9 = NULL;
11239 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
11240 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_10);
11241 if (likely(__pyx_t_9)) {
11242 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
11243 __Pyx_INCREF(__pyx_t_9);
11244 __Pyx_INCREF(function);
11245 __Pyx_DECREF_SET(__pyx_t_10, function);
11246 }
11247 }
11248 __pyx_t_11 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_9, __pyx_v_argname) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_argname);
11249 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11250 if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 415, __pyx_L1_error)
11251 __Pyx_GOTREF(__pyx_t_11);
11252 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11253 __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 415, __pyx_L1_error)
11254 __Pyx_GOTREF(__pyx_t_10);
11255 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
11256 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11257 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11258 __PYX_ERR(0, 415, __pyx_L1_error)
11259
11260 /* "pygame_sdl2/rect.pyx":414
11261 * pass
11262 *
11263 * if argname: # <<<<<<<<<<<<<<
11264 * raise TypeError("Argument {} must be a rect style object.".format(argname))
11265 * else:
11266 */
11267 }
11268
11269 /* "pygame_sdl2/rect.pyx":417
11270 * raise TypeError("Argument {} must be a rect style object.".format(argname))
11271 * else:
11272 * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<<
11273 */
11274 /*else*/ {
11275 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 417, __pyx_L1_error)
11276 __Pyx_GOTREF(__pyx_t_10);
11277 __Pyx_Raise(__pyx_t_10, 0, 0, 0);
11278 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11279 __PYX_ERR(0, 417, __pyx_L1_error)
11280 }
11281
11282 /* "pygame_sdl2/rect.pyx":381
11283 *
11284 *
11285 * cdef int to_sdl_rect(rectlike, SDL_Rect *rect, argname=None) except -1: # <<<<<<<<<<<<<<
11286 * """
11287 * Converts `rectlike` to the SDL_Rect `rect`.
11288 */
11289
11290 /* function exit code */
11291 __pyx_L1_error:;
11292 __Pyx_XDECREF(__pyx_t_6);
11293 __Pyx_XDECREF(__pyx_t_9);
11294 __Pyx_XDECREF(__pyx_t_10);
11295 __Pyx_XDECREF(__pyx_t_11);
11296 __Pyx_XDECREF(__pyx_t_12);
11297 __Pyx_AddTraceback("pygame_sdl2.rect.to_sdl_rect", __pyx_clineno, __pyx_lineno, __pyx_filename);
11298 __pyx_r = -1;
11299 __pyx_L0:;
11300 __Pyx_XDECREF((PyObject *)__pyx_v_rl);
11301 __Pyx_RefNannyFinishContext();
11302 return __pyx_r;
11303 }
11304
__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)11305 static PyObject *__pyx_tp_new_11pygame_sdl2_4rect_Rect(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
11306 PyObject *o;
11307 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
11308 o = (*t->tp_alloc)(t, 0);
11309 } else {
11310 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
11311 }
11312 if (unlikely(!o)) return 0;
11313 return o;
11314 }
11315
__pyx_tp_dealloc_11pygame_sdl2_4rect_Rect(PyObject * o)11316 static void __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect(PyObject *o) {
11317 struct __pyx_obj_11pygame_sdl2_4rect_Rect *p = (struct __pyx_obj_11pygame_sdl2_4rect_Rect *)o;
11318 #if CYTHON_USE_TP_FINALIZE
11319 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
11320 if (PyObject_CallFinalizerFromDealloc(o)) return;
11321 }
11322 #endif
11323 if (p->__weakref__) PyObject_ClearWeakRefs(o);
11324 (*Py_TYPE(o)->tp_free)(o);
11325 }
__pyx_sq_item_11pygame_sdl2_4rect_Rect(PyObject * o,Py_ssize_t i)11326 static PyObject *__pyx_sq_item_11pygame_sdl2_4rect_Rect(PyObject *o, Py_ssize_t i) {
11327 PyObject *r;
11328 PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
11329 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
11330 Py_DECREF(x);
11331 return r;
11332 }
11333
__pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect(PyObject * o,PyObject * i,PyObject * v)11334 static int __pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect(PyObject *o, PyObject *i, PyObject *v) {
11335 if (v) {
11336 return __pyx_pw_11pygame_sdl2_4rect_4Rect_15__setitem__(o, i, v);
11337 }
11338 else {
11339 PyErr_Format(PyExc_NotImplementedError,
11340 "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
11341 return -1;
11342 }
11343 }
11344
__pyx_getprop_11pygame_sdl2_4rect_4Rect_left(PyObject * o,CYTHON_UNUSED void * x)11345 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_left(PyObject *o, CYTHON_UNUSED void *x) {
11346 return __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_1__get__(o);
11347 }
11348
__pyx_setprop_11pygame_sdl2_4rect_4Rect_left(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11349 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_left(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11350 if (v) {
11351 return __pyx_pw_11pygame_sdl2_4rect_4Rect_4left_3__set__(o, v);
11352 }
11353 else {
11354 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11355 return -1;
11356 }
11357 }
11358
__pyx_getprop_11pygame_sdl2_4rect_4Rect_top(PyObject * o,CYTHON_UNUSED void * x)11359 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_top(PyObject *o, CYTHON_UNUSED void *x) {
11360 return __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_1__get__(o);
11361 }
11362
__pyx_setprop_11pygame_sdl2_4rect_4Rect_top(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11363 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_top(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11364 if (v) {
11365 return __pyx_pw_11pygame_sdl2_4rect_4Rect_3top_3__set__(o, v);
11366 }
11367 else {
11368 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11369 return -1;
11370 }
11371 }
11372
__pyx_getprop_11pygame_sdl2_4rect_4Rect_width(PyObject * o,CYTHON_UNUSED void * x)11373 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_width(PyObject *o, CYTHON_UNUSED void *x) {
11374 return __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_1__get__(o);
11375 }
11376
__pyx_setprop_11pygame_sdl2_4rect_4Rect_width(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11377 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11378 if (v) {
11379 return __pyx_pw_11pygame_sdl2_4rect_4Rect_5width_3__set__(o, v);
11380 }
11381 else {
11382 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11383 return -1;
11384 }
11385 }
11386
__pyx_getprop_11pygame_sdl2_4rect_4Rect_height(PyObject * o,CYTHON_UNUSED void * x)11387 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_height(PyObject *o, CYTHON_UNUSED void *x) {
11388 return __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_1__get__(o);
11389 }
11390
__pyx_setprop_11pygame_sdl2_4rect_4Rect_height(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11391 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_height(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11392 if (v) {
11393 return __pyx_pw_11pygame_sdl2_4rect_4Rect_6height_3__set__(o, v);
11394 }
11395 else {
11396 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11397 return -1;
11398 }
11399 }
11400
__pyx_getprop_11pygame_sdl2_4rect_4Rect_right(PyObject * o,CYTHON_UNUSED void * x)11401 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_right(PyObject *o, CYTHON_UNUSED void *x) {
11402 return __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_1__get__(o);
11403 }
11404
__pyx_setprop_11pygame_sdl2_4rect_4Rect_right(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11405 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_right(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11406 if (v) {
11407 return __pyx_pw_11pygame_sdl2_4rect_4Rect_5right_3__set__(o, v);
11408 }
11409 else {
11410 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11411 return -1;
11412 }
11413 }
11414
__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject * o,CYTHON_UNUSED void * x)11415 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject *o, CYTHON_UNUSED void *x) {
11416 return __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_1__get__(o);
11417 }
11418
__pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11419 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11420 if (v) {
11421 return __pyx_pw_11pygame_sdl2_4rect_4Rect_6bottom_3__set__(o, v);
11422 }
11423 else {
11424 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11425 return -1;
11426 }
11427 }
11428
__pyx_getprop_11pygame_sdl2_4rect_4Rect_size(PyObject * o,CYTHON_UNUSED void * x)11429 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_size(PyObject *o, CYTHON_UNUSED void *x) {
11430 return __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_1__get__(o);
11431 }
11432
__pyx_setprop_11pygame_sdl2_4rect_4Rect_size(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11433 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_size(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11434 if (v) {
11435 return __pyx_pw_11pygame_sdl2_4rect_4Rect_4size_3__set__(o, v);
11436 }
11437 else {
11438 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11439 return -1;
11440 }
11441 }
11442
__pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject * o,CYTHON_UNUSED void * x)11443 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject *o, CYTHON_UNUSED void *x) {
11444 return __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_1__get__(o);
11445 }
11446
__pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11447 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11448 if (v) {
11449 return __pyx_pw_11pygame_sdl2_4rect_4Rect_7topleft_3__set__(o, v);
11450 }
11451 else {
11452 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11453 return -1;
11454 }
11455 }
11456
__pyx_getprop_11pygame_sdl2_4rect_4Rect_topright(PyObject * o,CYTHON_UNUSED void * x)11457 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_topright(PyObject *o, CYTHON_UNUSED void *x) {
11458 return __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_1__get__(o);
11459 }
11460
__pyx_setprop_11pygame_sdl2_4rect_4Rect_topright(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11461 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_topright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11462 if (v) {
11463 return __pyx_pw_11pygame_sdl2_4rect_4Rect_8topright_3__set__(o, v);
11464 }
11465 else {
11466 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11467 return -1;
11468 }
11469 }
11470
__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject * o,CYTHON_UNUSED void * x)11471 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject *o, CYTHON_UNUSED void *x) {
11472 return __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_1__get__(o);
11473 }
11474
__pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11475 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11476 if (v) {
11477 return __pyx_pw_11pygame_sdl2_4rect_4Rect_11bottomright_3__set__(o, v);
11478 }
11479 else {
11480 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11481 return -1;
11482 }
11483 }
11484
__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject * o,CYTHON_UNUSED void * x)11485 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject *o, CYTHON_UNUSED void *x) {
11486 return __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_1__get__(o);
11487 }
11488
__pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11489 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11490 if (v) {
11491 return __pyx_pw_11pygame_sdl2_4rect_4Rect_10bottomleft_3__set__(o, v);
11492 }
11493 else {
11494 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11495 return -1;
11496 }
11497 }
11498
__pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject * o,CYTHON_UNUSED void * x)11499 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject *o, CYTHON_UNUSED void *x) {
11500 return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_1__get__(o);
11501 }
11502
__pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11503 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11504 if (v) {
11505 return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centerx_3__set__(o, v);
11506 }
11507 else {
11508 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11509 return -1;
11510 }
11511 }
11512
__pyx_getprop_11pygame_sdl2_4rect_4Rect_centery(PyObject * o,CYTHON_UNUSED void * x)11513 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_centery(PyObject *o, CYTHON_UNUSED void *x) {
11514 return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_1__get__(o);
11515 }
11516
__pyx_setprop_11pygame_sdl2_4rect_4Rect_centery(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11517 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_centery(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11518 if (v) {
11519 return __pyx_pw_11pygame_sdl2_4rect_4Rect_7centery_3__set__(o, v);
11520 }
11521 else {
11522 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11523 return -1;
11524 }
11525 }
11526
__pyx_getprop_11pygame_sdl2_4rect_4Rect_center(PyObject * o,CYTHON_UNUSED void * x)11527 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_center(PyObject *o, CYTHON_UNUSED void *x) {
11528 return __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_1__get__(o);
11529 }
11530
__pyx_setprop_11pygame_sdl2_4rect_4Rect_center(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11531 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_center(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11532 if (v) {
11533 return __pyx_pw_11pygame_sdl2_4rect_4Rect_6center_3__set__(o, v);
11534 }
11535 else {
11536 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11537 return -1;
11538 }
11539 }
11540
__pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject * o,CYTHON_UNUSED void * x)11541 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject *o, CYTHON_UNUSED void *x) {
11542 return __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_1__get__(o);
11543 }
11544
__pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11545 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11546 if (v) {
11547 return __pyx_pw_11pygame_sdl2_4rect_4Rect_6midtop_3__set__(o, v);
11548 }
11549 else {
11550 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11551 return -1;
11552 }
11553 }
11554
__pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject * o,CYTHON_UNUSED void * x)11555 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject *o, CYTHON_UNUSED void *x) {
11556 return __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_1__get__(o);
11557 }
11558
__pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11559 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11560 if (v) {
11561 return __pyx_pw_11pygame_sdl2_4rect_4Rect_7midleft_3__set__(o, v);
11562 }
11563 else {
11564 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11565 return -1;
11566 }
11567 }
11568
__pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject * o,CYTHON_UNUSED void * x)11569 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject *o, CYTHON_UNUSED void *x) {
11570 return __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_1__get__(o);
11571 }
11572
__pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11573 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11574 if (v) {
11575 return __pyx_pw_11pygame_sdl2_4rect_4Rect_9midbottom_3__set__(o, v);
11576 }
11577 else {
11578 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11579 return -1;
11580 }
11581 }
11582
__pyx_getprop_11pygame_sdl2_4rect_4Rect_midright(PyObject * o,CYTHON_UNUSED void * x)11583 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_midright(PyObject *o, CYTHON_UNUSED void *x) {
11584 return __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_1__get__(o);
11585 }
11586
__pyx_setprop_11pygame_sdl2_4rect_4Rect_midright(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11587 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_midright(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11588 if (v) {
11589 return __pyx_pw_11pygame_sdl2_4rect_4Rect_8midright_3__set__(o, v);
11590 }
11591 else {
11592 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11593 return -1;
11594 }
11595 }
11596
__pyx_getprop_11pygame_sdl2_4rect_4Rect_x(PyObject * o,CYTHON_UNUSED void * x)11597 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_x(PyObject *o, CYTHON_UNUSED void *x) {
11598 return __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_1__get__(o);
11599 }
11600
__pyx_setprop_11pygame_sdl2_4rect_4Rect_x(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11601 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_x(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11602 if (v) {
11603 return __pyx_pw_11pygame_sdl2_4rect_4Rect_1x_3__set__(o, v);
11604 }
11605 else {
11606 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11607 return -1;
11608 }
11609 }
11610
__pyx_getprop_11pygame_sdl2_4rect_4Rect_y(PyObject * o,CYTHON_UNUSED void * x)11611 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_y(PyObject *o, CYTHON_UNUSED void *x) {
11612 return __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_1__get__(o);
11613 }
11614
__pyx_setprop_11pygame_sdl2_4rect_4Rect_y(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11615 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_y(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11616 if (v) {
11617 return __pyx_pw_11pygame_sdl2_4rect_4Rect_1y_3__set__(o, v);
11618 }
11619 else {
11620 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11621 return -1;
11622 }
11623 }
11624
__pyx_getprop_11pygame_sdl2_4rect_4Rect_w(PyObject * o,CYTHON_UNUSED void * x)11625 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_w(PyObject *o, CYTHON_UNUSED void *x) {
11626 return __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_1__get__(o);
11627 }
11628
__pyx_setprop_11pygame_sdl2_4rect_4Rect_w(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11629 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_w(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11630 if (v) {
11631 return __pyx_pw_11pygame_sdl2_4rect_4Rect_1w_3__set__(o, v);
11632 }
11633 else {
11634 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11635 return -1;
11636 }
11637 }
11638
__pyx_getprop_11pygame_sdl2_4rect_4Rect_h(PyObject * o,CYTHON_UNUSED void * x)11639 static PyObject *__pyx_getprop_11pygame_sdl2_4rect_4Rect_h(PyObject *o, CYTHON_UNUSED void *x) {
11640 return __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_1__get__(o);
11641 }
11642
__pyx_setprop_11pygame_sdl2_4rect_4Rect_h(PyObject * o,PyObject * v,CYTHON_UNUSED void * x)11643 static int __pyx_setprop_11pygame_sdl2_4rect_4Rect_h(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
11644 if (v) {
11645 return __pyx_pw_11pygame_sdl2_4rect_4Rect_1h_3__set__(o, v);
11646 }
11647 else {
11648 PyErr_SetString(PyExc_NotImplementedError, "__del__");
11649 return -1;
11650 }
11651 }
11652
11653 static PyMethodDef __pyx_methods_11pygame_sdl2_4rect_Rect[] = {
11654 {"__reduce__", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_3__reduce__, METH_NOARGS, 0},
11655 {"copy", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_17copy, METH_NOARGS, 0},
11656 {"move", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_19move, METH_VARARGS|METH_KEYWORDS, 0},
11657 {"move_ip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_21move_ip, METH_VARARGS|METH_KEYWORDS, 0},
11658 {"inflate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_23inflate, METH_VARARGS|METH_KEYWORDS, 0},
11659 {"inflate_ip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_25inflate_ip, METH_VARARGS|METH_KEYWORDS, 0},
11660 {"clamp", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_27clamp, METH_O, 0},
11661 {"clamp_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_29clamp_ip, METH_O, 0},
11662 {"clip", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_31clip, METH_VARARGS|METH_KEYWORDS, 0},
11663 {"union", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_33union, METH_O, 0},
11664 {"union_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_35union_ip, METH_O, 0},
11665 {"unionall", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_37unionall, METH_O, 0},
11666 {"unionall_ip", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_39unionall_ip, METH_O, 0},
11667 {"fit", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_41fit, METH_O, 0},
11668 {"normalize", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_43normalize, METH_NOARGS, 0},
11669 {"contains", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_45contains, METH_O, 0},
11670 {"collidepoint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_47collidepoint, METH_VARARGS|METH_KEYWORDS, 0},
11671 {"colliderect", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_49colliderect, METH_O, 0},
11672 {"collidelist", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_51collidelist, METH_O, 0},
11673 {"collidelistall", (PyCFunction)__pyx_pw_11pygame_sdl2_4rect_4Rect_53collidelistall, METH_O, 0},
11674 {"collidedict", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_55collidedict, METH_VARARGS|METH_KEYWORDS, 0},
11675 {"collidedictall", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_11pygame_sdl2_4rect_4Rect_57collidedictall, METH_VARARGS|METH_KEYWORDS, 0},
11676 {0, 0, 0, 0}
11677 };
11678
11679 static struct PyGetSetDef __pyx_getsets_11pygame_sdl2_4rect_Rect[] = {
11680 {(char *)"left", __pyx_getprop_11pygame_sdl2_4rect_4Rect_left, __pyx_setprop_11pygame_sdl2_4rect_4Rect_left, (char *)0, 0},
11681 {(char *)"top", __pyx_getprop_11pygame_sdl2_4rect_4Rect_top, __pyx_setprop_11pygame_sdl2_4rect_4Rect_top, (char *)0, 0},
11682 {(char *)"width", __pyx_getprop_11pygame_sdl2_4rect_4Rect_width, __pyx_setprop_11pygame_sdl2_4rect_4Rect_width, (char *)0, 0},
11683 {(char *)"height", __pyx_getprop_11pygame_sdl2_4rect_4Rect_height, __pyx_setprop_11pygame_sdl2_4rect_4Rect_height, (char *)0, 0},
11684 {(char *)"right", __pyx_getprop_11pygame_sdl2_4rect_4Rect_right, __pyx_setprop_11pygame_sdl2_4rect_4Rect_right, (char *)0, 0},
11685 {(char *)"bottom", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottom, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottom, (char *)0, 0},
11686 {(char *)"size", __pyx_getprop_11pygame_sdl2_4rect_4Rect_size, __pyx_setprop_11pygame_sdl2_4rect_4Rect_size, (char *)0, 0},
11687 {(char *)"topleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_topleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_topleft, (char *)0, 0},
11688 {(char *)"topright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_topright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_topright, (char *)0, 0},
11689 {(char *)"bottomright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomright, (char *)0, 0},
11690 {(char *)"bottomleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_bottomleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_bottomleft, (char *)0, 0},
11691 {(char *)"centerx", __pyx_getprop_11pygame_sdl2_4rect_4Rect_centerx, __pyx_setprop_11pygame_sdl2_4rect_4Rect_centerx, (char *)0, 0},
11692 {(char *)"centery", __pyx_getprop_11pygame_sdl2_4rect_4Rect_centery, __pyx_setprop_11pygame_sdl2_4rect_4Rect_centery, (char *)0, 0},
11693 {(char *)"center", __pyx_getprop_11pygame_sdl2_4rect_4Rect_center, __pyx_setprop_11pygame_sdl2_4rect_4Rect_center, (char *)0, 0},
11694 {(char *)"midtop", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midtop, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midtop, (char *)0, 0},
11695 {(char *)"midleft", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midleft, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midleft, (char *)0, 0},
11696 {(char *)"midbottom", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midbottom, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midbottom, (char *)0, 0},
11697 {(char *)"midright", __pyx_getprop_11pygame_sdl2_4rect_4Rect_midright, __pyx_setprop_11pygame_sdl2_4rect_4Rect_midright, (char *)0, 0},
11698 {(char *)"x", __pyx_getprop_11pygame_sdl2_4rect_4Rect_x, __pyx_setprop_11pygame_sdl2_4rect_4Rect_x, (char *)0, 0},
11699 {(char *)"y", __pyx_getprop_11pygame_sdl2_4rect_4Rect_y, __pyx_setprop_11pygame_sdl2_4rect_4Rect_y, (char *)0, 0},
11700 {(char *)"w", __pyx_getprop_11pygame_sdl2_4rect_4Rect_w, __pyx_setprop_11pygame_sdl2_4rect_4Rect_w, (char *)0, 0},
11701 {(char *)"h", __pyx_getprop_11pygame_sdl2_4rect_4Rect_h, __pyx_setprop_11pygame_sdl2_4rect_4Rect_h, (char *)0, 0},
11702 {0, 0, 0, 0, 0}
11703 };
11704
11705 static PySequenceMethods __pyx_tp_as_sequence_Rect = {
11706 __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__, /*sq_length*/
11707 0, /*sq_concat*/
11708 0, /*sq_repeat*/
11709 __pyx_sq_item_11pygame_sdl2_4rect_Rect, /*sq_item*/
11710 0, /*sq_slice*/
11711 0, /*sq_ass_item*/
11712 0, /*sq_ass_slice*/
11713 0, /*sq_contains*/
11714 0, /*sq_inplace_concat*/
11715 0, /*sq_inplace_repeat*/
11716 };
11717
11718 static PyMappingMethods __pyx_tp_as_mapping_Rect = {
11719 __pyx_pw_11pygame_sdl2_4rect_4Rect_7__len__, /*mp_length*/
11720 __pyx_pw_11pygame_sdl2_4rect_4Rect_13__getitem__, /*mp_subscript*/
11721 __pyx_mp_ass_subscript_11pygame_sdl2_4rect_Rect, /*mp_ass_subscript*/
11722 };
11723
11724 static PyTypeObject __pyx_type_11pygame_sdl2_4rect_Rect = {
11725 PyVarObject_HEAD_INIT(0, 0)
11726 "pygame_sdl2.rect.Rect", /*tp_name*/
11727 sizeof(struct __pyx_obj_11pygame_sdl2_4rect_Rect), /*tp_basicsize*/
11728 0, /*tp_itemsize*/
11729 __pyx_tp_dealloc_11pygame_sdl2_4rect_Rect, /*tp_dealloc*/
11730 #if PY_VERSION_HEX < 0x030800b4
11731 0, /*tp_print*/
11732 #endif
11733 #if PY_VERSION_HEX >= 0x030800b4
11734 0, /*tp_vectorcall_offset*/
11735 #endif
11736 0, /*tp_getattr*/
11737 0, /*tp_setattr*/
11738 #if PY_MAJOR_VERSION < 3
11739 0, /*tp_compare*/
11740 #endif
11741 #if PY_MAJOR_VERSION >= 3
11742 0, /*tp_as_async*/
11743 #endif
11744 __pyx_pw_11pygame_sdl2_4rect_4Rect_5__repr__, /*tp_repr*/
11745 0, /*tp_as_number*/
11746 &__pyx_tp_as_sequence_Rect, /*tp_as_sequence*/
11747 &__pyx_tp_as_mapping_Rect, /*tp_as_mapping*/
11748 0, /*tp_hash*/
11749 0, /*tp_call*/
11750 0, /*tp_str*/
11751 0, /*tp_getattro*/
11752 0, /*tp_setattro*/
11753 0, /*tp_as_buffer*/
11754 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
11755 0, /*tp_doc*/
11756 0, /*tp_traverse*/
11757 0, /*tp_clear*/
11758 __pyx_pw_11pygame_sdl2_4rect_4Rect_11__richcmp__, /*tp_richcompare*/
11759 0, /*tp_weaklistoffset*/
11760 __pyx_pw_11pygame_sdl2_4rect_4Rect_9__iter__, /*tp_iter*/
11761 0, /*tp_iternext*/
11762 __pyx_methods_11pygame_sdl2_4rect_Rect, /*tp_methods*/
11763 0, /*tp_members*/
11764 __pyx_getsets_11pygame_sdl2_4rect_Rect, /*tp_getset*/
11765 0, /*tp_base*/
11766 0, /*tp_dict*/
11767 0, /*tp_descr_get*/
11768 0, /*tp_descr_set*/
11769 0, /*tp_dictoffset*/
11770 __pyx_pw_11pygame_sdl2_4rect_4Rect_1__init__, /*tp_init*/
11771 0, /*tp_alloc*/
11772 __pyx_tp_new_11pygame_sdl2_4rect_Rect, /*tp_new*/
11773 0, /*tp_free*/
11774 0, /*tp_is_gc*/
11775 0, /*tp_bases*/
11776 0, /*tp_mro*/
11777 0, /*tp_cache*/
11778 0, /*tp_subclasses*/
11779 0, /*tp_weaklist*/
11780 0, /*tp_del*/
11781 0, /*tp_version_tag*/
11782 #if PY_VERSION_HEX >= 0x030400a1
11783 0, /*tp_finalize*/
11784 #endif
11785 #if PY_VERSION_HEX >= 0x030800b1
11786 0, /*tp_vectorcall*/
11787 #endif
11788 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
11789 0, /*tp_print*/
11790 #endif
11791 };
11792
11793 static PyMethodDef __pyx_methods[] = {
11794 {0, 0, 0, 0}
11795 };
11796
11797 #if PY_MAJOR_VERSION >= 3
11798 #if CYTHON_PEP489_MULTI_PHASE_INIT
11799 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
11800 static int __pyx_pymod_exec_rect(PyObject* module); /*proto*/
11801 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
11802 {Py_mod_create, (void*)__pyx_pymod_create},
11803 {Py_mod_exec, (void*)__pyx_pymod_exec_rect},
11804 {0, NULL}
11805 };
11806 #endif
11807
11808 static struct PyModuleDef __pyx_moduledef = {
11809 PyModuleDef_HEAD_INIT,
11810 "pygame_sdl2.rect",
11811 0, /* m_doc */
11812 #if CYTHON_PEP489_MULTI_PHASE_INIT
11813 0, /* m_size */
11814 #else
11815 -1, /* m_size */
11816 #endif
11817 __pyx_methods /* m_methods */,
11818 #if CYTHON_PEP489_MULTI_PHASE_INIT
11819 __pyx_moduledef_slots, /* m_slots */
11820 #else
11821 NULL, /* m_reload */
11822 #endif
11823 NULL, /* m_traverse */
11824 NULL, /* m_clear */
11825 NULL /* m_free */
11826 };
11827 #endif
11828 #ifndef CYTHON_SMALL_CODE
11829 #if defined(__clang__)
11830 #define CYTHON_SMALL_CODE
11831 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
11832 #define CYTHON_SMALL_CODE __attribute__((cold))
11833 #else
11834 #define CYTHON_SMALL_CODE
11835 #endif
11836 #endif
11837
11838 static __Pyx_StringTabEntry __pyx_string_tab[] = {
11839 {&__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},
11840 {&__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},
11841 {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
11842 {&__pyx_n_s_Rect, __pyx_k_Rect, sizeof(__pyx_k_Rect), 0, 0, 1, 1},
11843 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
11844 {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
11845 {&__pyx_n_s_bottom, __pyx_k_bottom, sizeof(__pyx_k_bottom), 0, 0, 1, 1},
11846 {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1},
11847 {&__pyx_n_s_centerx, __pyx_k_centerx, sizeof(__pyx_k_centerx), 0, 0, 1, 1},
11848 {&__pyx_n_s_centery, __pyx_k_centery, sizeof(__pyx_k_centery), 0, 0, 1, 1},
11849 {&__pyx_n_s_clamp_ip, __pyx_k_clamp_ip, sizeof(__pyx_k_clamp_ip), 0, 0, 1, 1},
11850 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
11851 {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
11852 {&__pyx_n_s_colliderect, __pyx_k_colliderect, sizeof(__pyx_k_colliderect), 0, 0, 1, 1},
11853 {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
11854 {&__pyx_n_s_flatten, __pyx_k_flatten, sizeof(__pyx_k_flatten), 0, 0, 1, 1},
11855 {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
11856 {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
11857 {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
11858 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
11859 {&__pyx_n_s_inflate_ip, __pyx_k_inflate_ip, sizeof(__pyx_k_inflate_ip), 0, 0, 1, 1},
11860 {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
11861 {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1},
11862 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
11863 {&__pyx_n_s_move_ip, __pyx_k_move_ip, sizeof(__pyx_k_move_ip), 0, 0, 1, 1},
11864 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
11865 {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
11866 {&__pyx_n_s_other_dict, __pyx_k_other_dict, sizeof(__pyx_k_other_dict), 0, 0, 1, 1},
11867 {&__pyx_n_s_pygame_sdl2_rect, __pyx_k_pygame_sdl2_rect, sizeof(__pyx_k_pygame_sdl2_rect), 0, 0, 1, 1},
11868 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
11869 {&__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},
11870 {&__pyx_n_s_rects_values, __pyx_k_rects_values, sizeof(__pyx_k_rects_values), 0, 0, 1, 1},
11871 {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1},
11872 {&__pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_k_src_pygame_sdl2_rect_pyx, sizeof(__pyx_k_src_pygame_sdl2_rect_pyx), 0, 0, 1, 0},
11873 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
11874 {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1},
11875 {&__pyx_n_s_topleft, __pyx_k_topleft, sizeof(__pyx_k_topleft), 0, 0, 1, 1},
11876 {&__pyx_n_s_union_ip, __pyx_k_union_ip, sizeof(__pyx_k_union_ip), 0, 0, 1, 1},
11877 {&__pyx_n_s_unionall_ip, __pyx_k_unionall_ip, sizeof(__pyx_k_unionall_ip), 0, 0, 1, 1},
11878 {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
11879 {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
11880 {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
11881 {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
11882 {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
11883 {0, 0, 0, 0, 0, 0, 0}
11884 };
__Pyx_InitCachedBuiltins(void)11885 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
11886 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 61, __pyx_L1_error)
11887 __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 99, __pyx_L1_error)
11888 __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 354, __pyx_L1_error)
11889 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 354, __pyx_L1_error)
11890 return 0;
11891 __pyx_L1_error:;
11892 return -1;
11893 }
11894
__Pyx_InitCachedConstants(void)11895 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
11896 __Pyx_RefNannyDeclarations
11897 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
11898
11899 /* "pygame_sdl2/rect.pyx":61
11900 *
11901 * else:
11902 * raise TypeError("Argument must be a rect style object.") # <<<<<<<<<<<<<<
11903 *
11904 * self.x = x
11905 */
11906 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Argument_must_be_a_rect_style_ob); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 61, __pyx_L1_error)
11907 __Pyx_GOTREF(__pyx_tuple_);
11908 __Pyx_GIVEREF(__pyx_tuple_);
11909
11910 /* "pygame_sdl2/rect.pyx":263
11911 *
11912 * if not self.colliderect(other):
11913 * return Rect(0,0,0,0) # <<<<<<<<<<<<<<
11914 *
11915 * r = self.copy()
11916 */
11917 __pyx_tuple__2 = PyTuple_Pack(4, __pyx_int_0, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 263, __pyx_L1_error)
11918 __Pyx_GOTREF(__pyx_tuple__2);
11919 __Pyx_GIVEREF(__pyx_tuple__2);
11920
11921 /* "pygame_sdl2/rect.pyx":22
11922 * import collections
11923 *
11924 * def flatten(*args): # <<<<<<<<<<<<<<
11925 * if len(args) == 1:
11926 * return args[0]
11927 */
11928 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 22, __pyx_L1_error)
11929 __Pyx_GOTREF(__pyx_tuple__3);
11930 __Pyx_GIVEREF(__pyx_tuple__3);
11931 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_pygame_sdl2_rect_pyx, __pyx_n_s_flatten, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 22, __pyx_L1_error)
11932 __Pyx_RefNannyFinishContext();
11933 return 0;
11934 __pyx_L1_error:;
11935 __Pyx_RefNannyFinishContext();
11936 return -1;
11937 }
11938
__Pyx_InitGlobals(void)11939 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
11940 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
11941 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
11942 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
11943 __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
11944 __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
11945 __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
11946 return 0;
11947 __pyx_L1_error:;
11948 return -1;
11949 }
11950
11951 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
11952 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
11953 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
11954 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
11955 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
11956 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
11957 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
11958
__Pyx_modinit_global_init_code(void)11959 static int __Pyx_modinit_global_init_code(void) {
11960 __Pyx_RefNannyDeclarations
11961 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
11962 /*--- Global init code ---*/
11963 __Pyx_RefNannyFinishContext();
11964 return 0;
11965 }
11966
__Pyx_modinit_variable_export_code(void)11967 static int __Pyx_modinit_variable_export_code(void) {
11968 __Pyx_RefNannyDeclarations
11969 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
11970 /*--- Variable export code ---*/
11971 __Pyx_RefNannyFinishContext();
11972 return 0;
11973 }
11974
__Pyx_modinit_function_export_code(void)11975 static int __Pyx_modinit_function_export_code(void) {
11976 __Pyx_RefNannyDeclarations
11977 int __pyx_lineno = 0;
11978 const char *__pyx_filename = NULL;
11979 int __pyx_clineno = 0;
11980 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
11981 /*--- Function export code ---*/
11982 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_ERR(0, 1, __pyx_L1_error)
11983 __Pyx_RefNannyFinishContext();
11984 return 0;
11985 __pyx_L1_error:;
11986 __Pyx_RefNannyFinishContext();
11987 return -1;
11988 }
11989
__Pyx_modinit_type_init_code(void)11990 static int __Pyx_modinit_type_init_code(void) {
11991 __Pyx_RefNannyDeclarations
11992 int __pyx_lineno = 0;
11993 const char *__pyx_filename = NULL;
11994 int __pyx_clineno = 0;
11995 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
11996 /*--- Type init code ---*/
11997 if (PyType_Ready(&__pyx_type_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
11998 #if PY_VERSION_HEX < 0x030800B1
11999 __pyx_type_11pygame_sdl2_4rect_Rect.tp_print = 0;
12000 #endif
12001 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_11pygame_sdl2_4rect_Rect.tp_dictoffset && __pyx_type_11pygame_sdl2_4rect_Rect.tp_getattro == PyObject_GenericGetAttr)) {
12002 __pyx_type_11pygame_sdl2_4rect_Rect.tp_getattro = __Pyx_PyObject_GenericGetAttr;
12003 }
12004 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Rect, (PyObject *)&__pyx_type_11pygame_sdl2_4rect_Rect) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
12005 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__);
12006 __pyx_ptype_11pygame_sdl2_4rect_Rect = &__pyx_type_11pygame_sdl2_4rect_Rect;
12007 __Pyx_RefNannyFinishContext();
12008 return 0;
12009 __pyx_L1_error:;
12010 __Pyx_RefNannyFinishContext();
12011 return -1;
12012 }
12013
__Pyx_modinit_type_import_code(void)12014 static int __Pyx_modinit_type_import_code(void) {
12015 __Pyx_RefNannyDeclarations
12016 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
12017 /*--- Type import code ---*/
12018 __Pyx_RefNannyFinishContext();
12019 return 0;
12020 }
12021
__Pyx_modinit_variable_import_code(void)12022 static int __Pyx_modinit_variable_import_code(void) {
12023 __Pyx_RefNannyDeclarations
12024 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
12025 /*--- Variable import code ---*/
12026 __Pyx_RefNannyFinishContext();
12027 return 0;
12028 }
12029
__Pyx_modinit_function_import_code(void)12030 static int __Pyx_modinit_function_import_code(void) {
12031 __Pyx_RefNannyDeclarations
12032 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
12033 /*--- Function import code ---*/
12034 __Pyx_RefNannyFinishContext();
12035 return 0;
12036 }
12037
12038
12039 #ifndef CYTHON_NO_PYINIT_EXPORT
12040 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
12041 #elif PY_MAJOR_VERSION < 3
12042 #ifdef __cplusplus
12043 #define __Pyx_PyMODINIT_FUNC extern "C" void
12044 #else
12045 #define __Pyx_PyMODINIT_FUNC void
12046 #endif
12047 #else
12048 #ifdef __cplusplus
12049 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
12050 #else
12051 #define __Pyx_PyMODINIT_FUNC PyObject *
12052 #endif
12053 #endif
12054
12055
12056 #if PY_MAJOR_VERSION < 3
12057 __Pyx_PyMODINIT_FUNC initpygame_sdl2_rect(void) CYTHON_SMALL_CODE; /*proto*/
initpygame_sdl2_rect(void)12058 __Pyx_PyMODINIT_FUNC initpygame_sdl2_rect(void)
12059 #else
12060 __Pyx_PyMODINIT_FUNC PyInit_pygame_sdl2_rect(void) CYTHON_SMALL_CODE; /*proto*/
12061 __Pyx_PyMODINIT_FUNC PyInit_pygame_sdl2_rect(void)
12062 #if CYTHON_PEP489_MULTI_PHASE_INIT
12063 {
12064 return PyModuleDef_Init(&__pyx_moduledef);
12065 }
12066 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
12067 #if PY_VERSION_HEX >= 0x030700A1
12068 static PY_INT64_T main_interpreter_id = -1;
12069 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
12070 if (main_interpreter_id == -1) {
12071 main_interpreter_id = current_id;
12072 return (unlikely(current_id == -1)) ? -1 : 0;
12073 } else if (unlikely(main_interpreter_id != current_id))
12074 #else
12075 static PyInterpreterState *main_interpreter = NULL;
12076 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
12077 if (!main_interpreter) {
12078 main_interpreter = current_interpreter;
12079 } else if (unlikely(main_interpreter != current_interpreter))
12080 #endif
12081 {
12082 PyErr_SetString(
12083 PyExc_ImportError,
12084 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
12085 return -1;
12086 }
12087 return 0;
12088 }
12089 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
12090 PyObject *value = PyObject_GetAttrString(spec, from_name);
12091 int result = 0;
12092 if (likely(value)) {
12093 if (allow_none || value != Py_None) {
12094 result = PyDict_SetItemString(moddict, to_name, value);
12095 }
12096 Py_DECREF(value);
12097 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
12098 PyErr_Clear();
12099 } else {
12100 result = -1;
12101 }
12102 return result;
12103 }
12104 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
12105 PyObject *module = NULL, *moddict, *modname;
12106 if (__Pyx_check_single_interpreter())
12107 return NULL;
12108 if (__pyx_m)
12109 return __Pyx_NewRef(__pyx_m);
12110 modname = PyObject_GetAttrString(spec, "name");
12111 if (unlikely(!modname)) goto bad;
12112 module = PyModule_NewObject(modname);
12113 Py_DECREF(modname);
12114 if (unlikely(!module)) goto bad;
12115 moddict = PyModule_GetDict(module);
12116 if (unlikely(!moddict)) goto bad;
12117 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
12118 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
12119 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
12120 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
12121 return module;
12122 bad:
12123 Py_XDECREF(module);
12124 return NULL;
12125 }
12126
12127
12128 static CYTHON_SMALL_CODE int __pyx_pymod_exec_rect(PyObject *__pyx_pyinit_module)
12129 #endif
12130 #endif
12131 {
12132 PyObject *__pyx_t_1 = NULL;
12133 int __pyx_lineno = 0;
12134 const char *__pyx_filename = NULL;
12135 int __pyx_clineno = 0;
12136 __Pyx_RefNannyDeclarations
12137 #if CYTHON_PEP489_MULTI_PHASE_INIT
12138 if (__pyx_m) {
12139 if (__pyx_m == __pyx_pyinit_module) return 0;
12140 PyErr_SetString(PyExc_RuntimeError, "Module 'rect' has already been imported. Re-initialisation is not supported.");
12141 return -1;
12142 }
12143 #elif PY_MAJOR_VERSION >= 3
12144 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
12145 #endif
12146 #if CYTHON_REFNANNY
12147 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
12148 if (!__Pyx_RefNanny) {
12149 PyErr_Clear();
12150 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
12151 if (!__Pyx_RefNanny)
12152 Py_FatalError("failed to import 'refnanny' module");
12153 }
12154 #endif
12155 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_rect(void)", 0);
12156 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12157 #ifdef __Pxy_PyFrame_Initialize_Offsets
12158 __Pxy_PyFrame_Initialize_Offsets();
12159 #endif
12160 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
12161 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
12162 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
12163 #ifdef __Pyx_CyFunction_USED
12164 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12165 #endif
12166 #ifdef __Pyx_FusedFunction_USED
12167 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12168 #endif
12169 #ifdef __Pyx_Coroutine_USED
12170 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12171 #endif
12172 #ifdef __Pyx_Generator_USED
12173 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12174 #endif
12175 #ifdef __Pyx_AsyncGen_USED
12176 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12177 #endif
12178 #ifdef __Pyx_StopAsyncIteration_USED
12179 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12180 #endif
12181 /*--- Library function declarations ---*/
12182 /*--- Threads initialization code ---*/
12183 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
12184 #ifdef WITH_THREAD /* Python build with threading support? */
12185 PyEval_InitThreads();
12186 #endif
12187 #endif
12188 /*--- Module creation code ---*/
12189 #if CYTHON_PEP489_MULTI_PHASE_INIT
12190 __pyx_m = __pyx_pyinit_module;
12191 Py_INCREF(__pyx_m);
12192 #else
12193 #if PY_MAJOR_VERSION < 3
12194 __pyx_m = Py_InitModule4("pygame_sdl2.rect", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
12195 #else
12196 __pyx_m = PyModule_Create(&__pyx_moduledef);
12197 #endif
12198 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
12199 #endif
12200 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
12201 Py_INCREF(__pyx_d);
12202 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
12203 Py_INCREF(__pyx_b);
12204 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
12205 Py_INCREF(__pyx_cython_runtime);
12206 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
12207 /*--- Initialize various global constants etc. ---*/
12208 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12209 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
12210 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12211 #endif
12212 if (__pyx_module_is_main_pygame_sdl2__rect) {
12213 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12214 }
12215 #if PY_MAJOR_VERSION >= 3
12216 {
12217 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
12218 if (!PyDict_GetItemString(modules, "pygame_sdl2.rect")) {
12219 if (unlikely(PyDict_SetItemString(modules, "pygame_sdl2.rect", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
12220 }
12221 }
12222 #endif
12223 /*--- Builtin init code ---*/
12224 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12225 /*--- Constants init code ---*/
12226 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12227 /*--- Global type/function init code ---*/
12228 (void)__Pyx_modinit_global_init_code();
12229 (void)__Pyx_modinit_variable_export_code();
12230 if (unlikely(__Pyx_modinit_function_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
12231 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
12232 (void)__Pyx_modinit_type_import_code();
12233 (void)__Pyx_modinit_variable_import_code();
12234 (void)__Pyx_modinit_function_import_code();
12235 /*--- Execution code ---*/
12236 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
12237 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12238 #endif
12239
12240 /* "pygame_sdl2/rect.pyx":20
12241 * # 3. This notice may not be removed or altered from any source distribution.
12242 *
12243 * import collections # <<<<<<<<<<<<<<
12244 *
12245 * def flatten(*args):
12246 */
12247 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
12248 __Pyx_GOTREF(__pyx_t_1);
12249 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
12250 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12251
12252 /* "pygame_sdl2/rect.pyx":22
12253 * import collections
12254 *
12255 * def flatten(*args): # <<<<<<<<<<<<<<
12256 * if len(args) == 1:
12257 * return args[0]
12258 */
12259 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_11pygame_sdl2_4rect_1flatten, NULL, __pyx_n_s_pygame_sdl2_rect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
12260 __Pyx_GOTREF(__pyx_t_1);
12261 if (PyDict_SetItem(__pyx_d, __pyx_n_s_flatten, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
12262 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12263
12264 /* "pygame_sdl2/rect.pyx":1
12265 * # Copyright 2014 Tom Rothamel <tom@rothamel.us> # <<<<<<<<<<<<<<
12266 * # Copyright 2014 Patrick Dawson <pat@dw.is>
12267 * #
12268 */
12269 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
12270 __Pyx_GOTREF(__pyx_t_1);
12271 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
12272 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12273
12274 /*--- Wrapped vars code ---*/
12275
12276 goto __pyx_L0;
12277 __pyx_L1_error:;
12278 __Pyx_XDECREF(__pyx_t_1);
12279 if (__pyx_m) {
12280 if (__pyx_d) {
12281 __Pyx_AddTraceback("init pygame_sdl2.rect", __pyx_clineno, __pyx_lineno, __pyx_filename);
12282 }
12283 Py_CLEAR(__pyx_m);
12284 } else if (!PyErr_Occurred()) {
12285 PyErr_SetString(PyExc_ImportError, "init pygame_sdl2.rect");
12286 }
12287 __pyx_L0:;
12288 __Pyx_RefNannyFinishContext();
12289 #if CYTHON_PEP489_MULTI_PHASE_INIT
12290 return (__pyx_m != NULL) ? 0 : -1;
12291 #elif PY_MAJOR_VERSION >= 3
12292 return __pyx_m;
12293 #else
12294 return;
12295 #endif
12296 }
12297
12298 /* --- Runtime support code --- */
12299 /* Refnanny */
12300 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)12301 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
12302 PyObject *m = NULL, *p = NULL;
12303 void *r = NULL;
12304 m = PyImport_ImportModule(modname);
12305 if (!m) goto end;
12306 p = PyObject_GetAttrString(m, "RefNannyAPI");
12307 if (!p) goto end;
12308 r = PyLong_AsVoidPtr(p);
12309 end:
12310 Py_XDECREF(p);
12311 Py_XDECREF(m);
12312 return (__Pyx_RefNannyAPIStruct *)r;
12313 }
12314 #endif
12315
12316 /* PyObjectGetAttrStr */
12317 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)12318 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
12319 PyTypeObject* tp = Py_TYPE(obj);
12320 if (likely(tp->tp_getattro))
12321 return tp->tp_getattro(obj, attr_name);
12322 #if PY_MAJOR_VERSION < 3
12323 if (likely(tp->tp_getattr))
12324 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
12325 #endif
12326 return PyObject_GetAttr(obj, attr_name);
12327 }
12328 #endif
12329
12330 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)12331 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
12332 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
12333 if (unlikely(!result)) {
12334 PyErr_Format(PyExc_NameError,
12335 #if PY_MAJOR_VERSION >= 3
12336 "name '%U' is not defined", name);
12337 #else
12338 "name '%.200s' is not defined", PyString_AS_STRING(name));
12339 #endif
12340 }
12341 return result;
12342 }
12343
12344 /* KeywordStringCheck */
__Pyx_CheckKeywordStrings(PyObject * kwdict,const char * function_name,int kw_allowed)12345 static int __Pyx_CheckKeywordStrings(
12346 PyObject *kwdict,
12347 const char* function_name,
12348 int kw_allowed)
12349 {
12350 PyObject* key = 0;
12351 Py_ssize_t pos = 0;
12352 #if CYTHON_COMPILING_IN_PYPY
12353 if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
12354 goto invalid_keyword;
12355 return 1;
12356 #else
12357 while (PyDict_Next(kwdict, &pos, &key, 0)) {
12358 #if PY_MAJOR_VERSION < 3
12359 if (unlikely(!PyString_Check(key)))
12360 #endif
12361 if (unlikely(!PyUnicode_Check(key)))
12362 goto invalid_keyword_type;
12363 }
12364 if ((!kw_allowed) && unlikely(key))
12365 goto invalid_keyword;
12366 return 1;
12367 invalid_keyword_type:
12368 PyErr_Format(PyExc_TypeError,
12369 "%.200s() keywords must be strings", function_name);
12370 return 0;
12371 #endif
12372 invalid_keyword:
12373 PyErr_Format(PyExc_TypeError,
12374 #if PY_MAJOR_VERSION < 3
12375 "%.200s() got an unexpected keyword argument '%.200s'",
12376 function_name, PyString_AsString(key));
12377 #else
12378 "%s() got an unexpected keyword argument '%U'",
12379 function_name, key);
12380 #endif
12381 return 0;
12382 }
12383
12384 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)12385 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
12386 PyObject *r;
12387 if (!j) return NULL;
12388 r = PyObject_GetItem(o, j);
12389 Py_DECREF(j);
12390 return r;
12391 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)12392 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
12393 CYTHON_NCP_UNUSED int wraparound,
12394 CYTHON_NCP_UNUSED int boundscheck) {
12395 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12396 Py_ssize_t wrapped_i = i;
12397 if (wraparound & unlikely(i < 0)) {
12398 wrapped_i += PyList_GET_SIZE(o);
12399 }
12400 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
12401 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
12402 Py_INCREF(r);
12403 return r;
12404 }
12405 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
12406 #else
12407 return PySequence_GetItem(o, i);
12408 #endif
12409 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)12410 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
12411 CYTHON_NCP_UNUSED int wraparound,
12412 CYTHON_NCP_UNUSED int boundscheck) {
12413 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12414 Py_ssize_t wrapped_i = i;
12415 if (wraparound & unlikely(i < 0)) {
12416 wrapped_i += PyTuple_GET_SIZE(o);
12417 }
12418 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
12419 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
12420 Py_INCREF(r);
12421 return r;
12422 }
12423 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
12424 #else
12425 return PySequence_GetItem(o, i);
12426 #endif
12427 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)12428 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
12429 CYTHON_NCP_UNUSED int wraparound,
12430 CYTHON_NCP_UNUSED int boundscheck) {
12431 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
12432 if (is_list || PyList_CheckExact(o)) {
12433 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
12434 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
12435 PyObject *r = PyList_GET_ITEM(o, n);
12436 Py_INCREF(r);
12437 return r;
12438 }
12439 }
12440 else if (PyTuple_CheckExact(o)) {
12441 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
12442 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
12443 PyObject *r = PyTuple_GET_ITEM(o, n);
12444 Py_INCREF(r);
12445 return r;
12446 }
12447 } else {
12448 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
12449 if (likely(m && m->sq_item)) {
12450 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
12451 Py_ssize_t l = m->sq_length(o);
12452 if (likely(l >= 0)) {
12453 i += l;
12454 } else {
12455 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
12456 return NULL;
12457 PyErr_Clear();
12458 }
12459 }
12460 return m->sq_item(o, i);
12461 }
12462 }
12463 #else
12464 if (is_list || PySequence_Check(o)) {
12465 return PySequence_GetItem(o, i);
12466 }
12467 #endif
12468 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
12469 }
12470
12471 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)12472 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
12473 if (unlikely(!type)) {
12474 PyErr_SetString(PyExc_SystemError, "Missing type object");
12475 return 0;
12476 }
12477 if (likely(__Pyx_TypeCheck(obj, type)))
12478 return 1;
12479 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
12480 Py_TYPE(obj)->tp_name, type->tp_name);
12481 return 0;
12482 }
12483
12484 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)12485 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
12486 PyErr_Format(PyExc_ValueError,
12487 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
12488 }
12489
12490 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)12491 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
12492 PyErr_Format(PyExc_ValueError,
12493 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
12494 index, (index == 1) ? "" : "s");
12495 }
12496
12497 /* IterFinish */
__Pyx_IterFinish(void)12498 static CYTHON_INLINE int __Pyx_IterFinish(void) {
12499 #if CYTHON_FAST_THREAD_STATE
12500 PyThreadState *tstate = __Pyx_PyThreadState_Current;
12501 PyObject* exc_type = tstate->curexc_type;
12502 if (unlikely(exc_type)) {
12503 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
12504 PyObject *exc_value, *exc_tb;
12505 exc_value = tstate->curexc_value;
12506 exc_tb = tstate->curexc_traceback;
12507 tstate->curexc_type = 0;
12508 tstate->curexc_value = 0;
12509 tstate->curexc_traceback = 0;
12510 Py_DECREF(exc_type);
12511 Py_XDECREF(exc_value);
12512 Py_XDECREF(exc_tb);
12513 return 0;
12514 } else {
12515 return -1;
12516 }
12517 }
12518 return 0;
12519 #else
12520 if (unlikely(PyErr_Occurred())) {
12521 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
12522 PyErr_Clear();
12523 return 0;
12524 } else {
12525 return -1;
12526 }
12527 }
12528 return 0;
12529 #endif
12530 }
12531
12532 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)12533 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
12534 if (unlikely(retval)) {
12535 Py_DECREF(retval);
12536 __Pyx_RaiseTooManyValuesError(expected);
12537 return -1;
12538 } else {
12539 return __Pyx_IterFinish();
12540 }
12541 return 0;
12542 }
12543
12544 /* PyObjectCall */
12545 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)12546 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
12547 PyObject *result;
12548 ternaryfunc call = func->ob_type->tp_call;
12549 if (unlikely(!call))
12550 return PyObject_Call(func, arg, kw);
12551 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
12552 return NULL;
12553 result = (*call)(func, arg, kw);
12554 Py_LeaveRecursiveCall();
12555 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
12556 PyErr_SetString(
12557 PyExc_SystemError,
12558 "NULL result without error in PyObject_Call");
12559 }
12560 return result;
12561 }
12562 #endif
12563
12564 /* PyErrFetchRestore */
12565 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)12566 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
12567 PyObject *tmp_type, *tmp_value, *tmp_tb;
12568 tmp_type = tstate->curexc_type;
12569 tmp_value = tstate->curexc_value;
12570 tmp_tb = tstate->curexc_traceback;
12571 tstate->curexc_type = type;
12572 tstate->curexc_value = value;
12573 tstate->curexc_traceback = tb;
12574 Py_XDECREF(tmp_type);
12575 Py_XDECREF(tmp_value);
12576 Py_XDECREF(tmp_tb);
12577 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)12578 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
12579 *type = tstate->curexc_type;
12580 *value = tstate->curexc_value;
12581 *tb = tstate->curexc_traceback;
12582 tstate->curexc_type = 0;
12583 tstate->curexc_value = 0;
12584 tstate->curexc_traceback = 0;
12585 }
12586 #endif
12587
12588 /* RaiseException */
12589 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)12590 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
12591 CYTHON_UNUSED PyObject *cause) {
12592 __Pyx_PyThreadState_declare
12593 Py_XINCREF(type);
12594 if (!value || value == Py_None)
12595 value = NULL;
12596 else
12597 Py_INCREF(value);
12598 if (!tb || tb == Py_None)
12599 tb = NULL;
12600 else {
12601 Py_INCREF(tb);
12602 if (!PyTraceBack_Check(tb)) {
12603 PyErr_SetString(PyExc_TypeError,
12604 "raise: arg 3 must be a traceback or None");
12605 goto raise_error;
12606 }
12607 }
12608 if (PyType_Check(type)) {
12609 #if CYTHON_COMPILING_IN_PYPY
12610 if (!value) {
12611 Py_INCREF(Py_None);
12612 value = Py_None;
12613 }
12614 #endif
12615 PyErr_NormalizeException(&type, &value, &tb);
12616 } else {
12617 if (value) {
12618 PyErr_SetString(PyExc_TypeError,
12619 "instance exception may not have a separate value");
12620 goto raise_error;
12621 }
12622 value = type;
12623 type = (PyObject*) Py_TYPE(type);
12624 Py_INCREF(type);
12625 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
12626 PyErr_SetString(PyExc_TypeError,
12627 "raise: exception class must be a subclass of BaseException");
12628 goto raise_error;
12629 }
12630 }
12631 __Pyx_PyThreadState_assign
12632 __Pyx_ErrRestore(type, value, tb);
12633 return;
12634 raise_error:
12635 Py_XDECREF(value);
12636 Py_XDECREF(type);
12637 Py_XDECREF(tb);
12638 return;
12639 }
12640 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)12641 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
12642 PyObject* owned_instance = NULL;
12643 if (tb == Py_None) {
12644 tb = 0;
12645 } else if (tb && !PyTraceBack_Check(tb)) {
12646 PyErr_SetString(PyExc_TypeError,
12647 "raise: arg 3 must be a traceback or None");
12648 goto bad;
12649 }
12650 if (value == Py_None)
12651 value = 0;
12652 if (PyExceptionInstance_Check(type)) {
12653 if (value) {
12654 PyErr_SetString(PyExc_TypeError,
12655 "instance exception may not have a separate value");
12656 goto bad;
12657 }
12658 value = type;
12659 type = (PyObject*) Py_TYPE(value);
12660 } else if (PyExceptionClass_Check(type)) {
12661 PyObject *instance_class = NULL;
12662 if (value && PyExceptionInstance_Check(value)) {
12663 instance_class = (PyObject*) Py_TYPE(value);
12664 if (instance_class != type) {
12665 int is_subclass = PyObject_IsSubclass(instance_class, type);
12666 if (!is_subclass) {
12667 instance_class = NULL;
12668 } else if (unlikely(is_subclass == -1)) {
12669 goto bad;
12670 } else {
12671 type = instance_class;
12672 }
12673 }
12674 }
12675 if (!instance_class) {
12676 PyObject *args;
12677 if (!value)
12678 args = PyTuple_New(0);
12679 else if (PyTuple_Check(value)) {
12680 Py_INCREF(value);
12681 args = value;
12682 } else
12683 args = PyTuple_Pack(1, value);
12684 if (!args)
12685 goto bad;
12686 owned_instance = PyObject_Call(type, args, NULL);
12687 Py_DECREF(args);
12688 if (!owned_instance)
12689 goto bad;
12690 value = owned_instance;
12691 if (!PyExceptionInstance_Check(value)) {
12692 PyErr_Format(PyExc_TypeError,
12693 "calling %R should have returned an instance of "
12694 "BaseException, not %R",
12695 type, Py_TYPE(value));
12696 goto bad;
12697 }
12698 }
12699 } else {
12700 PyErr_SetString(PyExc_TypeError,
12701 "raise: exception class must be a subclass of BaseException");
12702 goto bad;
12703 }
12704 if (cause) {
12705 PyObject *fixed_cause;
12706 if (cause == Py_None) {
12707 fixed_cause = NULL;
12708 } else if (PyExceptionClass_Check(cause)) {
12709 fixed_cause = PyObject_CallObject(cause, NULL);
12710 if (fixed_cause == NULL)
12711 goto bad;
12712 } else if (PyExceptionInstance_Check(cause)) {
12713 fixed_cause = cause;
12714 Py_INCREF(fixed_cause);
12715 } else {
12716 PyErr_SetString(PyExc_TypeError,
12717 "exception causes must derive from "
12718 "BaseException");
12719 goto bad;
12720 }
12721 PyException_SetCause(value, fixed_cause);
12722 }
12723 PyErr_SetObject(type, value);
12724 if (tb) {
12725 #if CYTHON_COMPILING_IN_PYPY
12726 PyObject *tmp_type, *tmp_value, *tmp_tb;
12727 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
12728 Py_INCREF(tb);
12729 PyErr_Restore(tmp_type, tmp_value, tb);
12730 Py_XDECREF(tmp_tb);
12731 #else
12732 PyThreadState *tstate = __Pyx_PyThreadState_Current;
12733 PyObject* tmp_tb = tstate->curexc_traceback;
12734 if (tb != tmp_tb) {
12735 Py_INCREF(tb);
12736 tstate->curexc_traceback = tb;
12737 Py_XDECREF(tmp_tb);
12738 }
12739 #endif
12740 }
12741 bad:
12742 Py_XDECREF(owned_instance);
12743 return;
12744 }
12745 #endif
12746
12747 /* PyCFunctionFastCall */
12748 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)12749 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
12750 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
12751 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
12752 PyObject *self = PyCFunction_GET_SELF(func);
12753 int flags = PyCFunction_GET_FLAGS(func);
12754 assert(PyCFunction_Check(func));
12755 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
12756 assert(nargs >= 0);
12757 assert(nargs == 0 || args != NULL);
12758 /* _PyCFunction_FastCallDict() must not be called with an exception set,
12759 because it may clear it (directly or indirectly) and so the
12760 caller loses its exception */
12761 assert(!PyErr_Occurred());
12762 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
12763 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
12764 } else {
12765 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
12766 }
12767 }
12768 #endif
12769
12770 /* PyFunctionFastCall */
12771 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)12772 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
12773 PyObject *globals) {
12774 PyFrameObject *f;
12775 PyThreadState *tstate = __Pyx_PyThreadState_Current;
12776 PyObject **fastlocals;
12777 Py_ssize_t i;
12778 PyObject *result;
12779 assert(globals != NULL);
12780 /* XXX Perhaps we should create a specialized
12781 PyFrame_New() that doesn't take locals, but does
12782 take builtins without sanity checking them.
12783 */
12784 assert(tstate != NULL);
12785 f = PyFrame_New(tstate, co, globals, NULL);
12786 if (f == NULL) {
12787 return NULL;
12788 }
12789 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
12790 for (i = 0; i < na; i++) {
12791 Py_INCREF(*args);
12792 fastlocals[i] = *args++;
12793 }
12794 result = PyEval_EvalFrameEx(f,0);
12795 ++tstate->recursion_depth;
12796 Py_DECREF(f);
12797 --tstate->recursion_depth;
12798 return result;
12799 }
12800 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)12801 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
12802 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
12803 PyObject *globals = PyFunction_GET_GLOBALS(func);
12804 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
12805 PyObject *closure;
12806 #if PY_MAJOR_VERSION >= 3
12807 PyObject *kwdefs;
12808 #endif
12809 PyObject *kwtuple, **k;
12810 PyObject **d;
12811 Py_ssize_t nd;
12812 Py_ssize_t nk;
12813 PyObject *result;
12814 assert(kwargs == NULL || PyDict_Check(kwargs));
12815 nk = kwargs ? PyDict_Size(kwargs) : 0;
12816 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
12817 return NULL;
12818 }
12819 if (
12820 #if PY_MAJOR_VERSION >= 3
12821 co->co_kwonlyargcount == 0 &&
12822 #endif
12823 likely(kwargs == NULL || nk == 0) &&
12824 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
12825 if (argdefs == NULL && co->co_argcount == nargs) {
12826 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
12827 goto done;
12828 }
12829 else if (nargs == 0 && argdefs != NULL
12830 && co->co_argcount == Py_SIZE(argdefs)) {
12831 /* function called with no arguments, but all parameters have
12832 a default value: use default values as arguments .*/
12833 args = &PyTuple_GET_ITEM(argdefs, 0);
12834 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
12835 goto done;
12836 }
12837 }
12838 if (kwargs != NULL) {
12839 Py_ssize_t pos, i;
12840 kwtuple = PyTuple_New(2 * nk);
12841 if (kwtuple == NULL) {
12842 result = NULL;
12843 goto done;
12844 }
12845 k = &PyTuple_GET_ITEM(kwtuple, 0);
12846 pos = i = 0;
12847 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
12848 Py_INCREF(k[i]);
12849 Py_INCREF(k[i+1]);
12850 i += 2;
12851 }
12852 nk = i / 2;
12853 }
12854 else {
12855 kwtuple = NULL;
12856 k = NULL;
12857 }
12858 closure = PyFunction_GET_CLOSURE(func);
12859 #if PY_MAJOR_VERSION >= 3
12860 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
12861 #endif
12862 if (argdefs != NULL) {
12863 d = &PyTuple_GET_ITEM(argdefs, 0);
12864 nd = Py_SIZE(argdefs);
12865 }
12866 else {
12867 d = NULL;
12868 nd = 0;
12869 }
12870 #if PY_MAJOR_VERSION >= 3
12871 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
12872 args, (int)nargs,
12873 k, (int)nk,
12874 d, (int)nd, kwdefs, closure);
12875 #else
12876 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
12877 args, (int)nargs,
12878 k, (int)nk,
12879 d, (int)nd, closure);
12880 #endif
12881 Py_XDECREF(kwtuple);
12882 done:
12883 Py_LeaveRecursiveCall();
12884 return result;
12885 }
12886 #endif
12887 #endif
12888
12889 /* PyObjectCallMethO */
12890 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)12891 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
12892 PyObject *self, *result;
12893 PyCFunction cfunc;
12894 cfunc = PyCFunction_GET_FUNCTION(func);
12895 self = PyCFunction_GET_SELF(func);
12896 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
12897 return NULL;
12898 result = cfunc(self, arg);
12899 Py_LeaveRecursiveCall();
12900 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
12901 PyErr_SetString(
12902 PyExc_SystemError,
12903 "NULL result without error in PyObject_Call");
12904 }
12905 return result;
12906 }
12907 #endif
12908
12909 /* PyObjectCallOneArg */
12910 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)12911 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
12912 PyObject *result;
12913 PyObject *args = PyTuple_New(1);
12914 if (unlikely(!args)) return NULL;
12915 Py_INCREF(arg);
12916 PyTuple_SET_ITEM(args, 0, arg);
12917 result = __Pyx_PyObject_Call(func, args, NULL);
12918 Py_DECREF(args);
12919 return result;
12920 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)12921 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
12922 #if CYTHON_FAST_PYCALL
12923 if (PyFunction_Check(func)) {
12924 return __Pyx_PyFunction_FastCall(func, &arg, 1);
12925 }
12926 #endif
12927 if (likely(PyCFunction_Check(func))) {
12928 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
12929 return __Pyx_PyObject_CallMethO(func, arg);
12930 #if CYTHON_FAST_PYCCALL
12931 } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
12932 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
12933 #endif
12934 }
12935 }
12936 return __Pyx__PyObject_CallOneArg(func, arg);
12937 }
12938 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)12939 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
12940 PyObject *result;
12941 PyObject *args = PyTuple_Pack(1, arg);
12942 if (unlikely(!args)) return NULL;
12943 result = __Pyx_PyObject_Call(func, args, NULL);
12944 Py_DECREF(args);
12945 return result;
12946 }
12947 #endif
12948
12949 /* ObjectGetItem */
12950 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)12951 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
12952 PyObject *runerr;
12953 Py_ssize_t key_value;
12954 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
12955 if (unlikely(!(m && m->sq_item))) {
12956 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
12957 return NULL;
12958 }
12959 key_value = __Pyx_PyIndex_AsSsize_t(index);
12960 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
12961 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
12962 }
12963 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
12964 PyErr_Clear();
12965 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
12966 }
12967 return NULL;
12968 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)12969 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
12970 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
12971 if (likely(m && m->mp_subscript)) {
12972 return m->mp_subscript(obj, key);
12973 }
12974 return __Pyx_PyObject_GetIndex(obj, key);
12975 }
12976 #endif
12977
12978 /* PyIntCompare */
__Pyx_PyInt_EqObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,CYTHON_UNUSED long inplace)12979 static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
12980 if (op1 == op2) {
12981 Py_RETURN_TRUE;
12982 }
12983 #if PY_MAJOR_VERSION < 3
12984 if (likely(PyInt_CheckExact(op1))) {
12985 const long b = intval;
12986 long a = PyInt_AS_LONG(op1);
12987 if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
12988 }
12989 #endif
12990 #if CYTHON_USE_PYLONG_INTERNALS
12991 if (likely(PyLong_CheckExact(op1))) {
12992 int unequal;
12993 unsigned long uintval;
12994 Py_ssize_t size = Py_SIZE(op1);
12995 const digit* digits = ((PyLongObject*)op1)->ob_digit;
12996 if (intval == 0) {
12997 if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
12998 } else if (intval < 0) {
12999 if (size >= 0)
13000 Py_RETURN_FALSE;
13001 intval = -intval;
13002 size = -size;
13003 } else {
13004 if (size <= 0)
13005 Py_RETURN_FALSE;
13006 }
13007 uintval = (unsigned long) intval;
13008 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
13009 if (uintval >> (PyLong_SHIFT * 4)) {
13010 unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
13011 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
13012 } else
13013 #endif
13014 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
13015 if (uintval >> (PyLong_SHIFT * 3)) {
13016 unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
13017 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
13018 } else
13019 #endif
13020 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
13021 if (uintval >> (PyLong_SHIFT * 2)) {
13022 unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
13023 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
13024 } else
13025 #endif
13026 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
13027 if (uintval >> (PyLong_SHIFT * 1)) {
13028 unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
13029 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
13030 } else
13031 #endif
13032 unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
13033 if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
13034 }
13035 #endif
13036 if (PyFloat_CheckExact(op1)) {
13037 const long b = intval;
13038 double a = PyFloat_AS_DOUBLE(op1);
13039 if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
13040 }
13041 return (
13042 PyObject_RichCompare(op1, op2, Py_EQ));
13043 }
13044
13045 /* PyObjectSetAttrStr */
13046 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_SetAttrStr(PyObject * obj,PyObject * attr_name,PyObject * value)13047 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
13048 PyTypeObject* tp = Py_TYPE(obj);
13049 if (likely(tp->tp_setattro))
13050 return tp->tp_setattro(obj, attr_name, value);
13051 #if PY_MAJOR_VERSION < 3
13052 if (likely(tp->tp_setattr))
13053 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
13054 #endif
13055 return PyObject_SetAttr(obj, attr_name, value);
13056 }
13057 #endif
13058
13059 /* None */
__Pyx_div_long(long a,long b)13060 static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
13061 long q = a / b;
13062 long r = a - q*b;
13063 q -= ((r != 0) & ((r ^ b) < 0));
13064 return q;
13065 }
13066
13067 /* PyObjectCallNoArg */
13068 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)13069 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
13070 #if CYTHON_FAST_PYCALL
13071 if (PyFunction_Check(func)) {
13072 return __Pyx_PyFunction_FastCall(func, NULL, 0);
13073 }
13074 #endif
13075 #ifdef __Pyx_CyFunction_USED
13076 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
13077 #else
13078 if (likely(PyCFunction_Check(func)))
13079 #endif
13080 {
13081 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
13082 return __Pyx_PyObject_CallMethO(func, NULL);
13083 }
13084 }
13085 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
13086 }
13087 #endif
13088
13089 /* PyDictVersioning */
13090 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)13091 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
13092 PyObject *dict = Py_TYPE(obj)->tp_dict;
13093 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
13094 }
__Pyx_get_object_dict_version(PyObject * obj)13095 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
13096 PyObject **dictptr = NULL;
13097 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
13098 if (offset) {
13099 #if CYTHON_COMPILING_IN_CPYTHON
13100 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
13101 #else
13102 dictptr = _PyObject_GetDictPtr(obj);
13103 #endif
13104 }
13105 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
13106 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)13107 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
13108 PyObject *dict = Py_TYPE(obj)->tp_dict;
13109 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
13110 return 0;
13111 return obj_dict_version == __Pyx_get_object_dict_version(obj);
13112 }
13113 #endif
13114
13115 /* GetModuleGlobalName */
13116 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)13117 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
13118 #else
13119 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
13120 #endif
13121 {
13122 PyObject *result;
13123 #if !CYTHON_AVOID_BORROWED_REFS
13124 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
13125 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
13126 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
13127 if (likely(result)) {
13128 return __Pyx_NewRef(result);
13129 } else if (unlikely(PyErr_Occurred())) {
13130 return NULL;
13131 }
13132 #else
13133 result = PyDict_GetItem(__pyx_d, name);
13134 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
13135 if (likely(result)) {
13136 return __Pyx_NewRef(result);
13137 }
13138 #endif
13139 #else
13140 result = PyObject_GetItem(__pyx_d, name);
13141 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
13142 if (likely(result)) {
13143 return __Pyx_NewRef(result);
13144 }
13145 PyErr_Clear();
13146 #endif
13147 return __Pyx_GetBuiltinName(name);
13148 }
13149
13150 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)13151 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
13152 PyObject *args, *result = NULL;
13153 #if CYTHON_FAST_PYCALL
13154 if (PyFunction_Check(function)) {
13155 PyObject *args[2] = {arg1, arg2};
13156 return __Pyx_PyFunction_FastCall(function, args, 2);
13157 }
13158 #endif
13159 #if CYTHON_FAST_PYCCALL
13160 if (__Pyx_PyFastCFunction_Check(function)) {
13161 PyObject *args[2] = {arg1, arg2};
13162 return __Pyx_PyCFunction_FastCall(function, args, 2);
13163 }
13164 #endif
13165 args = PyTuple_New(2);
13166 if (unlikely(!args)) goto done;
13167 Py_INCREF(arg1);
13168 PyTuple_SET_ITEM(args, 0, arg1);
13169 Py_INCREF(arg2);
13170 PyTuple_SET_ITEM(args, 1, arg2);
13171 Py_INCREF(function);
13172 result = __Pyx_PyObject_Call(function, args, NULL);
13173 Py_DECREF(args);
13174 Py_DECREF(function);
13175 done:
13176 return result;
13177 }
13178
13179 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)13180 static void __Pyx_RaiseDoubleKeywordsError(
13181 const char* func_name,
13182 PyObject* kw_name)
13183 {
13184 PyErr_Format(PyExc_TypeError,
13185 #if PY_MAJOR_VERSION >= 3
13186 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
13187 #else
13188 "%s() got multiple values for keyword argument '%s'", func_name,
13189 PyString_AsString(kw_name));
13190 #endif
13191 }
13192
13193 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)13194 static int __Pyx_ParseOptionalKeywords(
13195 PyObject *kwds,
13196 PyObject **argnames[],
13197 PyObject *kwds2,
13198 PyObject *values[],
13199 Py_ssize_t num_pos_args,
13200 const char* function_name)
13201 {
13202 PyObject *key = 0, *value = 0;
13203 Py_ssize_t pos = 0;
13204 PyObject*** name;
13205 PyObject*** first_kw_arg = argnames + num_pos_args;
13206 while (PyDict_Next(kwds, &pos, &key, &value)) {
13207 name = first_kw_arg;
13208 while (*name && (**name != key)) name++;
13209 if (*name) {
13210 values[name-argnames] = value;
13211 continue;
13212 }
13213 name = first_kw_arg;
13214 #if PY_MAJOR_VERSION < 3
13215 if (likely(PyString_Check(key))) {
13216 while (*name) {
13217 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
13218 && _PyString_Eq(**name, key)) {
13219 values[name-argnames] = value;
13220 break;
13221 }
13222 name++;
13223 }
13224 if (*name) continue;
13225 else {
13226 PyObject*** argname = argnames;
13227 while (argname != first_kw_arg) {
13228 if ((**argname == key) || (
13229 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
13230 && _PyString_Eq(**argname, key))) {
13231 goto arg_passed_twice;
13232 }
13233 argname++;
13234 }
13235 }
13236 } else
13237 #endif
13238 if (likely(PyUnicode_Check(key))) {
13239 while (*name) {
13240 int cmp = (**name == key) ? 0 :
13241 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
13242 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
13243 #endif
13244 PyUnicode_Compare(**name, key);
13245 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
13246 if (cmp == 0) {
13247 values[name-argnames] = value;
13248 break;
13249 }
13250 name++;
13251 }
13252 if (*name) continue;
13253 else {
13254 PyObject*** argname = argnames;
13255 while (argname != first_kw_arg) {
13256 int cmp = (**argname == key) ? 0 :
13257 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
13258 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
13259 #endif
13260 PyUnicode_Compare(**argname, key);
13261 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
13262 if (cmp == 0) goto arg_passed_twice;
13263 argname++;
13264 }
13265 }
13266 } else
13267 goto invalid_keyword_type;
13268 if (kwds2) {
13269 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
13270 } else {
13271 goto invalid_keyword;
13272 }
13273 }
13274 return 0;
13275 arg_passed_twice:
13276 __Pyx_RaiseDoubleKeywordsError(function_name, key);
13277 goto bad;
13278 invalid_keyword_type:
13279 PyErr_Format(PyExc_TypeError,
13280 "%.200s() keywords must be strings", function_name);
13281 goto bad;
13282 invalid_keyword:
13283 PyErr_Format(PyExc_TypeError,
13284 #if PY_MAJOR_VERSION < 3
13285 "%.200s() got an unexpected keyword argument '%.200s'",
13286 function_name, PyString_AsString(key));
13287 #else
13288 "%s() got an unexpected keyword argument '%U'",
13289 function_name, key);
13290 #endif
13291 bad:
13292 return -1;
13293 }
13294
13295 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)13296 static void __Pyx_RaiseArgtupleInvalid(
13297 const char* func_name,
13298 int exact,
13299 Py_ssize_t num_min,
13300 Py_ssize_t num_max,
13301 Py_ssize_t num_found)
13302 {
13303 Py_ssize_t num_expected;
13304 const char *more_or_less;
13305 if (num_found < num_min) {
13306 num_expected = num_min;
13307 more_or_less = "at least";
13308 } else {
13309 num_expected = num_max;
13310 more_or_less = "at most";
13311 }
13312 if (exact) {
13313 more_or_less = "exactly";
13314 }
13315 PyErr_Format(PyExc_TypeError,
13316 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
13317 func_name, more_or_less, num_expected,
13318 (num_expected == 1) ? "" : "s", num_found);
13319 }
13320
13321 /* GetTopmostException */
13322 #if CYTHON_USE_EXC_INFO_STACK
13323 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)13324 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
13325 {
13326 _PyErr_StackItem *exc_info = tstate->exc_info;
13327 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
13328 exc_info->previous_item != NULL)
13329 {
13330 exc_info = exc_info->previous_item;
13331 }
13332 return exc_info;
13333 }
13334 #endif
13335
13336 /* SaveResetException */
13337 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)13338 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
13339 #if CYTHON_USE_EXC_INFO_STACK
13340 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
13341 *type = exc_info->exc_type;
13342 *value = exc_info->exc_value;
13343 *tb = exc_info->exc_traceback;
13344 #else
13345 *type = tstate->exc_type;
13346 *value = tstate->exc_value;
13347 *tb = tstate->exc_traceback;
13348 #endif
13349 Py_XINCREF(*type);
13350 Py_XINCREF(*value);
13351 Py_XINCREF(*tb);
13352 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)13353 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
13354 PyObject *tmp_type, *tmp_value, *tmp_tb;
13355 #if CYTHON_USE_EXC_INFO_STACK
13356 _PyErr_StackItem *exc_info = tstate->exc_info;
13357 tmp_type = exc_info->exc_type;
13358 tmp_value = exc_info->exc_value;
13359 tmp_tb = exc_info->exc_traceback;
13360 exc_info->exc_type = type;
13361 exc_info->exc_value = value;
13362 exc_info->exc_traceback = tb;
13363 #else
13364 tmp_type = tstate->exc_type;
13365 tmp_value = tstate->exc_value;
13366 tmp_tb = tstate->exc_traceback;
13367 tstate->exc_type = type;
13368 tstate->exc_value = value;
13369 tstate->exc_traceback = tb;
13370 #endif
13371 Py_XDECREF(tmp_type);
13372 Py_XDECREF(tmp_value);
13373 Py_XDECREF(tmp_tb);
13374 }
13375 #endif
13376
13377 /* PyObject_GenericGetAttrNoDict */
13378 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)13379 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
13380 PyErr_Format(PyExc_AttributeError,
13381 #if PY_MAJOR_VERSION >= 3
13382 "'%.50s' object has no attribute '%U'",
13383 tp->tp_name, attr_name);
13384 #else
13385 "'%.50s' object has no attribute '%.400s'",
13386 tp->tp_name, PyString_AS_STRING(attr_name));
13387 #endif
13388 return NULL;
13389 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)13390 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
13391 PyObject *descr;
13392 PyTypeObject *tp = Py_TYPE(obj);
13393 if (unlikely(!PyString_Check(attr_name))) {
13394 return PyObject_GenericGetAttr(obj, attr_name);
13395 }
13396 assert(!tp->tp_dictoffset);
13397 descr = _PyType_Lookup(tp, attr_name);
13398 if (unlikely(!descr)) {
13399 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
13400 }
13401 Py_INCREF(descr);
13402 #if PY_MAJOR_VERSION < 3
13403 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
13404 #endif
13405 {
13406 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
13407 if (unlikely(f)) {
13408 PyObject *res = f(descr, obj, (PyObject *)tp);
13409 Py_DECREF(descr);
13410 return res;
13411 }
13412 }
13413 return descr;
13414 }
13415 #endif
13416
13417 /* PyObject_GenericGetAttr */
13418 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)13419 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
13420 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
13421 return PyObject_GenericGetAttr(obj, attr_name);
13422 }
13423 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
13424 }
13425 #endif
13426
13427 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)13428 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
13429 PyObject *empty_list = 0;
13430 PyObject *module = 0;
13431 PyObject *global_dict = 0;
13432 PyObject *empty_dict = 0;
13433 PyObject *list;
13434 #if PY_MAJOR_VERSION < 3
13435 PyObject *py_import;
13436 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
13437 if (!py_import)
13438 goto bad;
13439 #endif
13440 if (from_list)
13441 list = from_list;
13442 else {
13443 empty_list = PyList_New(0);
13444 if (!empty_list)
13445 goto bad;
13446 list = empty_list;
13447 }
13448 global_dict = PyModule_GetDict(__pyx_m);
13449 if (!global_dict)
13450 goto bad;
13451 empty_dict = PyDict_New();
13452 if (!empty_dict)
13453 goto bad;
13454 {
13455 #if PY_MAJOR_VERSION >= 3
13456 if (level == -1) {
13457 if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
13458 module = PyImport_ImportModuleLevelObject(
13459 name, global_dict, empty_dict, list, 1);
13460 if (!module) {
13461 if (!PyErr_ExceptionMatches(PyExc_ImportError))
13462 goto bad;
13463 PyErr_Clear();
13464 }
13465 }
13466 level = 0;
13467 }
13468 #endif
13469 if (!module) {
13470 #if PY_MAJOR_VERSION < 3
13471 PyObject *py_level = PyInt_FromLong(level);
13472 if (!py_level)
13473 goto bad;
13474 module = PyObject_CallFunctionObjArgs(py_import,
13475 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
13476 Py_DECREF(py_level);
13477 #else
13478 module = PyImport_ImportModuleLevelObject(
13479 name, global_dict, empty_dict, list, level);
13480 #endif
13481 }
13482 }
13483 bad:
13484 #if PY_MAJOR_VERSION < 3
13485 Py_XDECREF(py_import);
13486 #endif
13487 Py_XDECREF(empty_list);
13488 Py_XDECREF(empty_dict);
13489 return module;
13490 }
13491
13492 /* CLineInTraceback */
13493 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)13494 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
13495 PyObject *use_cline;
13496 PyObject *ptype, *pvalue, *ptraceback;
13497 #if CYTHON_COMPILING_IN_CPYTHON
13498 PyObject **cython_runtime_dict;
13499 #endif
13500 if (unlikely(!__pyx_cython_runtime)) {
13501 return c_line;
13502 }
13503 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
13504 #if CYTHON_COMPILING_IN_CPYTHON
13505 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
13506 if (likely(cython_runtime_dict)) {
13507 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
13508 use_cline, *cython_runtime_dict,
13509 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
13510 } else
13511 #endif
13512 {
13513 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
13514 if (use_cline_obj) {
13515 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
13516 Py_DECREF(use_cline_obj);
13517 } else {
13518 PyErr_Clear();
13519 use_cline = NULL;
13520 }
13521 }
13522 if (!use_cline) {
13523 c_line = 0;
13524 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
13525 }
13526 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
13527 c_line = 0;
13528 }
13529 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
13530 return c_line;
13531 }
13532 #endif
13533
13534 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)13535 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
13536 int start = 0, mid = 0, end = count - 1;
13537 if (end >= 0 && code_line > entries[end].code_line) {
13538 return count;
13539 }
13540 while (start < end) {
13541 mid = start + (end - start) / 2;
13542 if (code_line < entries[mid].code_line) {
13543 end = mid;
13544 } else if (code_line > entries[mid].code_line) {
13545 start = mid + 1;
13546 } else {
13547 return mid;
13548 }
13549 }
13550 if (code_line <= entries[mid].code_line) {
13551 return mid;
13552 } else {
13553 return mid + 1;
13554 }
13555 }
__pyx_find_code_object(int code_line)13556 static PyCodeObject *__pyx_find_code_object(int code_line) {
13557 PyCodeObject* code_object;
13558 int pos;
13559 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
13560 return NULL;
13561 }
13562 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
13563 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
13564 return NULL;
13565 }
13566 code_object = __pyx_code_cache.entries[pos].code_object;
13567 Py_INCREF(code_object);
13568 return code_object;
13569 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)13570 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
13571 int pos, i;
13572 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
13573 if (unlikely(!code_line)) {
13574 return;
13575 }
13576 if (unlikely(!entries)) {
13577 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
13578 if (likely(entries)) {
13579 __pyx_code_cache.entries = entries;
13580 __pyx_code_cache.max_count = 64;
13581 __pyx_code_cache.count = 1;
13582 entries[0].code_line = code_line;
13583 entries[0].code_object = code_object;
13584 Py_INCREF(code_object);
13585 }
13586 return;
13587 }
13588 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
13589 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
13590 PyCodeObject* tmp = entries[pos].code_object;
13591 entries[pos].code_object = code_object;
13592 Py_DECREF(tmp);
13593 return;
13594 }
13595 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
13596 int new_max = __pyx_code_cache.max_count + 64;
13597 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
13598 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
13599 if (unlikely(!entries)) {
13600 return;
13601 }
13602 __pyx_code_cache.entries = entries;
13603 __pyx_code_cache.max_count = new_max;
13604 }
13605 for (i=__pyx_code_cache.count; i>pos; i--) {
13606 entries[i] = entries[i-1];
13607 }
13608 entries[pos].code_line = code_line;
13609 entries[pos].code_object = code_object;
13610 __pyx_code_cache.count++;
13611 Py_INCREF(code_object);
13612 }
13613
13614 /* AddTraceback */
13615 #include "compile.h"
13616 #include "frameobject.h"
13617 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)13618 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
13619 const char *funcname, int c_line,
13620 int py_line, const char *filename) {
13621 PyCodeObject *py_code = 0;
13622 PyObject *py_srcfile = 0;
13623 PyObject *py_funcname = 0;
13624 #if PY_MAJOR_VERSION < 3
13625 py_srcfile = PyString_FromString(filename);
13626 #else
13627 py_srcfile = PyUnicode_FromString(filename);
13628 #endif
13629 if (!py_srcfile) goto bad;
13630 if (c_line) {
13631 #if PY_MAJOR_VERSION < 3
13632 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
13633 #else
13634 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
13635 #endif
13636 }
13637 else {
13638 #if PY_MAJOR_VERSION < 3
13639 py_funcname = PyString_FromString(funcname);
13640 #else
13641 py_funcname = PyUnicode_FromString(funcname);
13642 #endif
13643 }
13644 if (!py_funcname) goto bad;
13645 py_code = __Pyx_PyCode_New(
13646 0,
13647 0,
13648 0,
13649 0,
13650 0,
13651 __pyx_empty_bytes, /*PyObject *code,*/
13652 __pyx_empty_tuple, /*PyObject *consts,*/
13653 __pyx_empty_tuple, /*PyObject *names,*/
13654 __pyx_empty_tuple, /*PyObject *varnames,*/
13655 __pyx_empty_tuple, /*PyObject *freevars,*/
13656 __pyx_empty_tuple, /*PyObject *cellvars,*/
13657 py_srcfile, /*PyObject *filename,*/
13658 py_funcname, /*PyObject *name,*/
13659 py_line,
13660 __pyx_empty_bytes /*PyObject *lnotab*/
13661 );
13662 Py_DECREF(py_srcfile);
13663 Py_DECREF(py_funcname);
13664 return py_code;
13665 bad:
13666 Py_XDECREF(py_srcfile);
13667 Py_XDECREF(py_funcname);
13668 return NULL;
13669 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)13670 static void __Pyx_AddTraceback(const char *funcname, int c_line,
13671 int py_line, const char *filename) {
13672 PyCodeObject *py_code = 0;
13673 PyFrameObject *py_frame = 0;
13674 PyThreadState *tstate = __Pyx_PyThreadState_Current;
13675 if (c_line) {
13676 c_line = __Pyx_CLineForTraceback(tstate, c_line);
13677 }
13678 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
13679 if (!py_code) {
13680 py_code = __Pyx_CreateCodeObjectForTraceback(
13681 funcname, c_line, py_line, filename);
13682 if (!py_code) goto bad;
13683 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
13684 }
13685 py_frame = PyFrame_New(
13686 tstate, /*PyThreadState *tstate,*/
13687 py_code, /*PyCodeObject *code,*/
13688 __pyx_d, /*PyObject *globals,*/
13689 0 /*PyObject *locals*/
13690 );
13691 if (!py_frame) goto bad;
13692 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
13693 PyTraceBack_Here(py_frame);
13694 bad:
13695 Py_XDECREF(py_code);
13696 Py_XDECREF(py_frame);
13697 }
13698
13699 /* CIntFromPyVerify */
13700 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
13701 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
13702 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
13703 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
13704 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
13705 {\
13706 func_type value = func_value;\
13707 if (sizeof(target_type) < sizeof(func_type)) {\
13708 if (unlikely(value != (func_type) (target_type) value)) {\
13709 func_type zero = 0;\
13710 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
13711 return (target_type) -1;\
13712 if (is_unsigned && unlikely(value < zero))\
13713 goto raise_neg_overflow;\
13714 else\
13715 goto raise_overflow;\
13716 }\
13717 }\
13718 return (target_type) value;\
13719 }
13720
13721 /* CIntToPy */
__Pyx_PyInt_From_long(long value)13722 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
13723 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
13724 const int is_unsigned = neg_one > const_zero;
13725 if (is_unsigned) {
13726 if (sizeof(long) < sizeof(long)) {
13727 return PyInt_FromLong((long) value);
13728 } else if (sizeof(long) <= sizeof(unsigned long)) {
13729 return PyLong_FromUnsignedLong((unsigned long) value);
13730 #ifdef HAVE_LONG_LONG
13731 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
13732 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
13733 #endif
13734 }
13735 } else {
13736 if (sizeof(long) <= sizeof(long)) {
13737 return PyInt_FromLong((long) value);
13738 #ifdef HAVE_LONG_LONG
13739 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
13740 return PyLong_FromLongLong((PY_LONG_LONG) value);
13741 #endif
13742 }
13743 }
13744 {
13745 int one = 1; int little = (int)*(unsigned char *)&one;
13746 unsigned char *bytes = (unsigned char *)&value;
13747 return _PyLong_FromByteArray(bytes, sizeof(long),
13748 little, !is_unsigned);
13749 }
13750 }
13751
13752 /* CIntToPy */
__Pyx_PyInt_From_int(int value)13753 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
13754 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
13755 const int is_unsigned = neg_one > const_zero;
13756 if (is_unsigned) {
13757 if (sizeof(int) < sizeof(long)) {
13758 return PyInt_FromLong((long) value);
13759 } else if (sizeof(int) <= sizeof(unsigned long)) {
13760 return PyLong_FromUnsignedLong((unsigned long) value);
13761 #ifdef HAVE_LONG_LONG
13762 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
13763 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
13764 #endif
13765 }
13766 } else {
13767 if (sizeof(int) <= sizeof(long)) {
13768 return PyInt_FromLong((long) value);
13769 #ifdef HAVE_LONG_LONG
13770 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
13771 return PyLong_FromLongLong((PY_LONG_LONG) value);
13772 #endif
13773 }
13774 }
13775 {
13776 int one = 1; int little = (int)*(unsigned char *)&one;
13777 unsigned char *bytes = (unsigned char *)&value;
13778 return _PyLong_FromByteArray(bytes, sizeof(int),
13779 little, !is_unsigned);
13780 }
13781 }
13782
13783 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)13784 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
13785 const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
13786 const int is_unsigned = neg_one > const_zero;
13787 #if PY_MAJOR_VERSION < 3
13788 if (likely(PyInt_Check(x))) {
13789 if (sizeof(int) < sizeof(long)) {
13790 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
13791 } else {
13792 long val = PyInt_AS_LONG(x);
13793 if (is_unsigned && unlikely(val < 0)) {
13794 goto raise_neg_overflow;
13795 }
13796 return (int) val;
13797 }
13798 } else
13799 #endif
13800 if (likely(PyLong_Check(x))) {
13801 if (is_unsigned) {
13802 #if CYTHON_USE_PYLONG_INTERNALS
13803 const digit* digits = ((PyLongObject*)x)->ob_digit;
13804 switch (Py_SIZE(x)) {
13805 case 0: return (int) 0;
13806 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
13807 case 2:
13808 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
13809 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13810 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13811 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
13812 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
13813 }
13814 }
13815 break;
13816 case 3:
13817 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
13818 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13819 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13820 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
13821 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
13822 }
13823 }
13824 break;
13825 case 4:
13826 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
13827 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13828 __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])))
13829 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
13830 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
13831 }
13832 }
13833 break;
13834 }
13835 #endif
13836 #if CYTHON_COMPILING_IN_CPYTHON
13837 if (unlikely(Py_SIZE(x) < 0)) {
13838 goto raise_neg_overflow;
13839 }
13840 #else
13841 {
13842 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
13843 if (unlikely(result < 0))
13844 return (int) -1;
13845 if (unlikely(result == 1))
13846 goto raise_neg_overflow;
13847 }
13848 #endif
13849 if (sizeof(int) <= sizeof(unsigned long)) {
13850 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
13851 #ifdef HAVE_LONG_LONG
13852 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
13853 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
13854 #endif
13855 }
13856 } else {
13857 #if CYTHON_USE_PYLONG_INTERNALS
13858 const digit* digits = ((PyLongObject*)x)->ob_digit;
13859 switch (Py_SIZE(x)) {
13860 case 0: return (int) 0;
13861 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
13862 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
13863 case -2:
13864 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
13865 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13866 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13867 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
13868 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13869 }
13870 }
13871 break;
13872 case 2:
13873 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
13874 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13875 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13876 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
13877 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13878 }
13879 }
13880 break;
13881 case -3:
13882 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
13883 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13884 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13885 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
13886 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13887 }
13888 }
13889 break;
13890 case 3:
13891 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
13892 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
13893 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
13894 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
13895 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13896 }
13897 }
13898 break;
13899 case -4:
13900 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
13901 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13902 __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])))
13903 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
13904 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13905 }
13906 }
13907 break;
13908 case 4:
13909 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
13910 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
13911 __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])))
13912 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
13913 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
13914 }
13915 }
13916 break;
13917 }
13918 #endif
13919 if (sizeof(int) <= sizeof(long)) {
13920 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
13921 #ifdef HAVE_LONG_LONG
13922 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
13923 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
13924 #endif
13925 }
13926 }
13927 {
13928 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
13929 PyErr_SetString(PyExc_RuntimeError,
13930 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
13931 #else
13932 int val;
13933 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
13934 #if PY_MAJOR_VERSION < 3
13935 if (likely(v) && !PyLong_Check(v)) {
13936 PyObject *tmp = v;
13937 v = PyNumber_Long(tmp);
13938 Py_DECREF(tmp);
13939 }
13940 #endif
13941 if (likely(v)) {
13942 int one = 1; int is_little = (int)*(unsigned char *)&one;
13943 unsigned char *bytes = (unsigned char *)&val;
13944 int ret = _PyLong_AsByteArray((PyLongObject *)v,
13945 bytes, sizeof(val),
13946 is_little, !is_unsigned);
13947 Py_DECREF(v);
13948 if (likely(!ret))
13949 return val;
13950 }
13951 #endif
13952 return (int) -1;
13953 }
13954 } else {
13955 int val;
13956 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
13957 if (!tmp) return (int) -1;
13958 val = __Pyx_PyInt_As_int(tmp);
13959 Py_DECREF(tmp);
13960 return val;
13961 }
13962 raise_overflow:
13963 PyErr_SetString(PyExc_OverflowError,
13964 "value too large to convert to int");
13965 return (int) -1;
13966 raise_neg_overflow:
13967 PyErr_SetString(PyExc_OverflowError,
13968 "can't convert negative value to int");
13969 return (int) -1;
13970 }
13971
13972 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)13973 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
13974 const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
13975 const int is_unsigned = neg_one > const_zero;
13976 #if PY_MAJOR_VERSION < 3
13977 if (likely(PyInt_Check(x))) {
13978 if (sizeof(long) < sizeof(long)) {
13979 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
13980 } else {
13981 long val = PyInt_AS_LONG(x);
13982 if (is_unsigned && unlikely(val < 0)) {
13983 goto raise_neg_overflow;
13984 }
13985 return (long) val;
13986 }
13987 } else
13988 #endif
13989 if (likely(PyLong_Check(x))) {
13990 if (is_unsigned) {
13991 #if CYTHON_USE_PYLONG_INTERNALS
13992 const digit* digits = ((PyLongObject*)x)->ob_digit;
13993 switch (Py_SIZE(x)) {
13994 case 0: return (long) 0;
13995 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
13996 case 2:
13997 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
13998 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
13999 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14000 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
14001 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14002 }
14003 }
14004 break;
14005 case 3:
14006 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
14007 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
14008 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14009 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
14010 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14011 }
14012 }
14013 break;
14014 case 4:
14015 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
14016 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
14017 __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])))
14018 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
14019 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
14020 }
14021 }
14022 break;
14023 }
14024 #endif
14025 #if CYTHON_COMPILING_IN_CPYTHON
14026 if (unlikely(Py_SIZE(x) < 0)) {
14027 goto raise_neg_overflow;
14028 }
14029 #else
14030 {
14031 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
14032 if (unlikely(result < 0))
14033 return (long) -1;
14034 if (unlikely(result == 1))
14035 goto raise_neg_overflow;
14036 }
14037 #endif
14038 if (sizeof(long) <= sizeof(unsigned long)) {
14039 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
14040 #ifdef HAVE_LONG_LONG
14041 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
14042 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
14043 #endif
14044 }
14045 } else {
14046 #if CYTHON_USE_PYLONG_INTERNALS
14047 const digit* digits = ((PyLongObject*)x)->ob_digit;
14048 switch (Py_SIZE(x)) {
14049 case 0: return (long) 0;
14050 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
14051 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
14052 case -2:
14053 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
14054 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
14055 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14056 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
14057 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14058 }
14059 }
14060 break;
14061 case 2:
14062 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
14063 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
14064 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14065 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
14066 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14067 }
14068 }
14069 break;
14070 case -3:
14071 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
14072 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
14073 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14074 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
14075 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14076 }
14077 }
14078 break;
14079 case 3:
14080 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
14081 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
14082 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
14083 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
14084 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14085 }
14086 }
14087 break;
14088 case -4:
14089 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
14090 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
14091 __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])))
14092 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
14093 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14094 }
14095 }
14096 break;
14097 case 4:
14098 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
14099 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
14100 __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])))
14101 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
14102 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
14103 }
14104 }
14105 break;
14106 }
14107 #endif
14108 if (sizeof(long) <= sizeof(long)) {
14109 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
14110 #ifdef HAVE_LONG_LONG
14111 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
14112 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
14113 #endif
14114 }
14115 }
14116 {
14117 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
14118 PyErr_SetString(PyExc_RuntimeError,
14119 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
14120 #else
14121 long val;
14122 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
14123 #if PY_MAJOR_VERSION < 3
14124 if (likely(v) && !PyLong_Check(v)) {
14125 PyObject *tmp = v;
14126 v = PyNumber_Long(tmp);
14127 Py_DECREF(tmp);
14128 }
14129 #endif
14130 if (likely(v)) {
14131 int one = 1; int is_little = (int)*(unsigned char *)&one;
14132 unsigned char *bytes = (unsigned char *)&val;
14133 int ret = _PyLong_AsByteArray((PyLongObject *)v,
14134 bytes, sizeof(val),
14135 is_little, !is_unsigned);
14136 Py_DECREF(v);
14137 if (likely(!ret))
14138 return val;
14139 }
14140 #endif
14141 return (long) -1;
14142 }
14143 } else {
14144 long val;
14145 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
14146 if (!tmp) return (long) -1;
14147 val = __Pyx_PyInt_As_long(tmp);
14148 Py_DECREF(tmp);
14149 return val;
14150 }
14151 raise_overflow:
14152 PyErr_SetString(PyExc_OverflowError,
14153 "value too large to convert to long");
14154 return (long) -1;
14155 raise_neg_overflow:
14156 PyErr_SetString(PyExc_OverflowError,
14157 "can't convert negative value to long");
14158 return (long) -1;
14159 }
14160
14161 /* FastTypeChecks */
14162 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)14163 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
14164 while (a) {
14165 a = a->tp_base;
14166 if (a == b)
14167 return 1;
14168 }
14169 return b == &PyBaseObject_Type;
14170 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)14171 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
14172 PyObject *mro;
14173 if (a == b) return 1;
14174 mro = a->tp_mro;
14175 if (likely(mro)) {
14176 Py_ssize_t i, n;
14177 n = PyTuple_GET_SIZE(mro);
14178 for (i = 0; i < n; i++) {
14179 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
14180 return 1;
14181 }
14182 return 0;
14183 }
14184 return __Pyx_InBases(a, b);
14185 }
14186 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)14187 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
14188 PyObject *exception, *value, *tb;
14189 int res;
14190 __Pyx_PyThreadState_declare
14191 __Pyx_PyThreadState_assign
14192 __Pyx_ErrFetch(&exception, &value, &tb);
14193 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
14194 if (unlikely(res == -1)) {
14195 PyErr_WriteUnraisable(err);
14196 res = 0;
14197 }
14198 if (!res) {
14199 res = PyObject_IsSubclass(err, exc_type2);
14200 if (unlikely(res == -1)) {
14201 PyErr_WriteUnraisable(err);
14202 res = 0;
14203 }
14204 }
14205 __Pyx_ErrRestore(exception, value, tb);
14206 return res;
14207 }
14208 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)14209 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
14210 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
14211 if (!res) {
14212 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
14213 }
14214 return res;
14215 }
14216 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)14217 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
14218 Py_ssize_t i, n;
14219 assert(PyExceptionClass_Check(exc_type));
14220 n = PyTuple_GET_SIZE(tuple);
14221 #if PY_MAJOR_VERSION >= 3
14222 for (i=0; i<n; i++) {
14223 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
14224 }
14225 #endif
14226 for (i=0; i<n; i++) {
14227 PyObject *t = PyTuple_GET_ITEM(tuple, i);
14228 #if PY_MAJOR_VERSION < 3
14229 if (likely(exc_type == t)) return 1;
14230 #endif
14231 if (likely(PyExceptionClass_Check(t))) {
14232 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
14233 } else {
14234 }
14235 }
14236 return 0;
14237 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)14238 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
14239 if (likely(err == exc_type)) return 1;
14240 if (likely(PyExceptionClass_Check(err))) {
14241 if (likely(PyExceptionClass_Check(exc_type))) {
14242 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
14243 } else if (likely(PyTuple_Check(exc_type))) {
14244 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
14245 } else {
14246 }
14247 }
14248 return PyErr_GivenExceptionMatches(err, exc_type);
14249 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)14250 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
14251 assert(PyExceptionClass_Check(exc_type1));
14252 assert(PyExceptionClass_Check(exc_type2));
14253 if (likely(err == exc_type1 || err == exc_type2)) return 1;
14254 if (likely(PyExceptionClass_Check(err))) {
14255 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
14256 }
14257 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
14258 }
14259 #endif
14260
14261 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)14262 static int __Pyx_check_binary_version(void) {
14263 char ctversion[4], rtversion[4];
14264 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
14265 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
14266 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
14267 char message[200];
14268 PyOS_snprintf(message, sizeof(message),
14269 "compiletime version %s of module '%.100s' "
14270 "does not match runtime version %s",
14271 ctversion, __Pyx_MODULE_NAME, rtversion);
14272 return PyErr_WarnEx(NULL, message, 1);
14273 }
14274 return 0;
14275 }
14276
14277 /* FunctionExport */
__Pyx_ExportFunction(const char * name,void (* f)(void),const char * sig)14278 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
14279 PyObject *d = 0;
14280 PyObject *cobj = 0;
14281 union {
14282 void (*fp)(void);
14283 void *p;
14284 } tmp;
14285 d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
14286 if (!d) {
14287 PyErr_Clear();
14288 d = PyDict_New();
14289 if (!d)
14290 goto bad;
14291 Py_INCREF(d);
14292 if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
14293 goto bad;
14294 }
14295 tmp.fp = f;
14296 #if PY_VERSION_HEX >= 0x02070000
14297 cobj = PyCapsule_New(tmp.p, sig, 0);
14298 #else
14299 cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0);
14300 #endif
14301 if (!cobj)
14302 goto bad;
14303 if (PyDict_SetItemString(d, name, cobj) < 0)
14304 goto bad;
14305 Py_DECREF(cobj);
14306 Py_DECREF(d);
14307 return 0;
14308 bad:
14309 Py_XDECREF(cobj);
14310 Py_XDECREF(d);
14311 return -1;
14312 }
14313
14314 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)14315 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
14316 while (t->p) {
14317 #if PY_MAJOR_VERSION < 3
14318 if (t->is_unicode) {
14319 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
14320 } else if (t->intern) {
14321 *t->p = PyString_InternFromString(t->s);
14322 } else {
14323 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
14324 }
14325 #else
14326 if (t->is_unicode | t->is_str) {
14327 if (t->intern) {
14328 *t->p = PyUnicode_InternFromString(t->s);
14329 } else if (t->encoding) {
14330 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
14331 } else {
14332 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
14333 }
14334 } else {
14335 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
14336 }
14337 #endif
14338 if (!*t->p)
14339 return -1;
14340 if (PyObject_Hash(*t->p) == -1)
14341 return -1;
14342 ++t;
14343 }
14344 return 0;
14345 }
14346
__Pyx_PyUnicode_FromString(const char * c_str)14347 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
14348 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
14349 }
__Pyx_PyObject_AsString(PyObject * o)14350 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
14351 Py_ssize_t ignore;
14352 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
14353 }
14354 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
14355 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)14356 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14357 char* defenc_c;
14358 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
14359 if (!defenc) return NULL;
14360 defenc_c = PyBytes_AS_STRING(defenc);
14361 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
14362 {
14363 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
14364 char* c;
14365 for (c = defenc_c; c < end; c++) {
14366 if ((unsigned char) (*c) >= 128) {
14367 PyUnicode_AsASCIIString(o);
14368 return NULL;
14369 }
14370 }
14371 }
14372 #endif
14373 *length = PyBytes_GET_SIZE(defenc);
14374 return defenc_c;
14375 }
14376 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)14377 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14378 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
14379 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
14380 if (likely(PyUnicode_IS_ASCII(o))) {
14381 *length = PyUnicode_GET_LENGTH(o);
14382 return PyUnicode_AsUTF8(o);
14383 } else {
14384 PyUnicode_AsASCIIString(o);
14385 return NULL;
14386 }
14387 #else
14388 return PyUnicode_AsUTF8AndSize(o, length);
14389 #endif
14390 }
14391 #endif
14392 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)14393 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
14394 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
14395 if (
14396 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
14397 __Pyx_sys_getdefaultencoding_not_ascii &&
14398 #endif
14399 PyUnicode_Check(o)) {
14400 return __Pyx_PyUnicode_AsStringAndSize(o, length);
14401 } else
14402 #endif
14403 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
14404 if (PyByteArray_Check(o)) {
14405 *length = PyByteArray_GET_SIZE(o);
14406 return PyByteArray_AS_STRING(o);
14407 } else
14408 #endif
14409 {
14410 char* result;
14411 int r = PyBytes_AsStringAndSize(o, &result, length);
14412 if (unlikely(r < 0)) {
14413 return NULL;
14414 } else {
14415 return result;
14416 }
14417 }
14418 }
__Pyx_PyObject_IsTrue(PyObject * x)14419 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
14420 int is_true = x == Py_True;
14421 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
14422 else return PyObject_IsTrue(x);
14423 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)14424 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
14425 int retval;
14426 if (unlikely(!x)) return -1;
14427 retval = __Pyx_PyObject_IsTrue(x);
14428 Py_DECREF(x);
14429 return retval;
14430 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)14431 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
14432 #if PY_MAJOR_VERSION >= 3
14433 if (PyLong_Check(result)) {
14434 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
14435 "__int__ returned non-int (type %.200s). "
14436 "The ability to return an instance of a strict subclass of int "
14437 "is deprecated, and may be removed in a future version of Python.",
14438 Py_TYPE(result)->tp_name)) {
14439 Py_DECREF(result);
14440 return NULL;
14441 }
14442 return result;
14443 }
14444 #endif
14445 PyErr_Format(PyExc_TypeError,
14446 "__%.4s__ returned non-%.4s (type %.200s)",
14447 type_name, type_name, Py_TYPE(result)->tp_name);
14448 Py_DECREF(result);
14449 return NULL;
14450 }
__Pyx_PyNumber_IntOrLong(PyObject * x)14451 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
14452 #if CYTHON_USE_TYPE_SLOTS
14453 PyNumberMethods *m;
14454 #endif
14455 const char *name = NULL;
14456 PyObject *res = NULL;
14457 #if PY_MAJOR_VERSION < 3
14458 if (likely(PyInt_Check(x) || PyLong_Check(x)))
14459 #else
14460 if (likely(PyLong_Check(x)))
14461 #endif
14462 return __Pyx_NewRef(x);
14463 #if CYTHON_USE_TYPE_SLOTS
14464 m = Py_TYPE(x)->tp_as_number;
14465 #if PY_MAJOR_VERSION < 3
14466 if (m && m->nb_int) {
14467 name = "int";
14468 res = m->nb_int(x);
14469 }
14470 else if (m && m->nb_long) {
14471 name = "long";
14472 res = m->nb_long(x);
14473 }
14474 #else
14475 if (likely(m && m->nb_int)) {
14476 name = "int";
14477 res = m->nb_int(x);
14478 }
14479 #endif
14480 #else
14481 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
14482 res = PyNumber_Int(x);
14483 }
14484 #endif
14485 if (likely(res)) {
14486 #if PY_MAJOR_VERSION < 3
14487 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
14488 #else
14489 if (unlikely(!PyLong_CheckExact(res))) {
14490 #endif
14491 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
14492 }
14493 }
14494 else if (!PyErr_Occurred()) {
14495 PyErr_SetString(PyExc_TypeError,
14496 "an integer is required");
14497 }
14498 return res;
14499 }
14500 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
14501 Py_ssize_t ival;
14502 PyObject *x;
14503 #if PY_MAJOR_VERSION < 3
14504 if (likely(PyInt_CheckExact(b))) {
14505 if (sizeof(Py_ssize_t) >= sizeof(long))
14506 return PyInt_AS_LONG(b);
14507 else
14508 return PyInt_AsSsize_t(b);
14509 }
14510 #endif
14511 if (likely(PyLong_CheckExact(b))) {
14512 #if CYTHON_USE_PYLONG_INTERNALS
14513 const digit* digits = ((PyLongObject*)b)->ob_digit;
14514 const Py_ssize_t size = Py_SIZE(b);
14515 if (likely(__Pyx_sst_abs(size) <= 1)) {
14516 ival = likely(size) ? digits[0] : 0;
14517 if (size == -1) ival = -ival;
14518 return ival;
14519 } else {
14520 switch (size) {
14521 case 2:
14522 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
14523 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
14524 }
14525 break;
14526 case -2:
14527 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
14528 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
14529 }
14530 break;
14531 case 3:
14532 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
14533 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
14534 }
14535 break;
14536 case -3:
14537 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
14538 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
14539 }
14540 break;
14541 case 4:
14542 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
14543 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]));
14544 }
14545 break;
14546 case -4:
14547 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
14548 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]));
14549 }
14550 break;
14551 }
14552 }
14553 #endif
14554 return PyLong_AsSsize_t(b);
14555 }
14556 x = PyNumber_Index(b);
14557 if (!x) return -1;
14558 ival = PyInt_AsSsize_t(x);
14559 Py_DECREF(x);
14560 return ival;
14561 }
14562 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
14563 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
14564 }
14565 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
14566 return PyInt_FromSize_t(ival);
14567 }
14568
14569
14570 #endif /* Py_PYTHON_H */
14571
14572
14573 static struct _inittab pygame_sdl2_rect_inittab[] = {
14574 #if PY_MAJOR_VERSION < 3
14575 { "pygame_sdl2.rect", initpygame_sdl2_rect },
14576 #else
14577 { "pygame_sdl2.rect", PyInit_pygame_sdl2_rect },
14578 #endif
14579 { NULL, NULL },
14580 };
14581
14582 static void pygame_sdl2_rect_constructor(void) __attribute__((constructor));
14583
14584 static void pygame_sdl2_rect_constructor(void) {
14585 PyImport_ExtendInittab(pygame_sdl2_rect_inittab);
14586 }
14587